https://bugs.documentfoundation.org/show_bug.cgi?id=164865

            Bug ID: 164865
           Summary: [RFE] Calc: Export to (X)HTML: convert
                    comments/annotations into footnotes -- pandoc-style
           Product: LibreOffice
           Version: 24.2.7.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
When exporting a sheet as (X)HTML, any cell's comment is currently exported as
an "inline" <span> within the <td> bearing the cell's content. That is, the
comment shows in the same table cell on top of the cell's original content. 

[*] I use HTML export for reverse pandoc processing into markdown, so that I
can easily copy/paste into other .md documents. This is anyway secondary wrt to
the general usage of just exporting to HTML for Web publishing, etc.

Example:

[Calc visual format]

             | Author, timestamp
            _| -------
           / | blah, blah
    +-----+
    | foo |
    +-----+

becomes:

[Web browser rendering]

    [ANNOTATION:

    BY 'Unknown Author'
    ON '2025-01-26T17:05:00'
    NOTE: 'blah, blah']

    foo

[simplified HTML]

    <td>
        <span title="annotation">
            <br>[ANNOTATION:
            <br><br>
            <span title="dc:creator">BY 'Unknown Author'</span>
                <br>
                <span title="dc:date">ON '2025-01-26T17:05:00'</span>
                <br>
                <span>NOTE: 'blah, blah'</span>]
            </span>
        <p>foo</p>
    </td>


The rendered HTML, besides being, IMHO, visually unpleasant, is difficult to
process by external tools [*] because lacks a proper semantic -- indeed, only
the "title" attribute conveys some information. 

I suggest to render the comment as a pseudo-footnote, i.e., add a traling
superscript number to the cell's original content linked to a <div> element in
a pseudo-list (<ol><li>... would be better but the note number would be unknown
before rendering) placed below the table. For example, this is how pandoc would
render it (notice my added extra '&nbsp;' to avoid confusion with exponents):

[pandoc-style]

    <table>
        <tr>
            <td>
                <p>foo&nbsp;
                    <a href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref">
                        <sup>1</sup>
                    </a>
                </p>
            </td>
        </tr>
    </table>

    <aside id="footnotes-1" class="footnotes footnotes-end-of-section"
role="doc-footnote">
        <hr>
        <ol start="1">
            <li id="fn1">
                <p>blah, blah
                    <a href="#fnref1" class="footnote-back"
role="doc-backlink">&#8617;</a>
                </p>
            </li>
        </ol>
    </aside>



Steps to Reproduce:
1. Fill a cell with content
2. Add a comment to the cell
3. Export as (X)HTML

Actual Results:
Cell's comment is rendered as an "inline" <span> before the <td> content. See
part "[Web browser rendering]" in the Description above.

Expected Results:
Cell's comment is rendered as a superscript hyperlink to an <ol> list element
outside the table.
See part "[pandoc-style]" in the Description above.


Reproducible: Always


User Profile Reset: No

Additional Info:
See also Bug #88156.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to