Bug 164865 - [RFE] Calc: Export to (X)HTML: convert comments/annotations into footnotes -- pandoc-style
Summary: [RFE] Calc: Export to (X)HTML: convert comments/annotations into footnotes --...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.7.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2025-01-26 17:28 UTC by ^m'e
Modified: 2025-07-14 13:38 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Example of pandoc-rendered table cell with comment (612 bytes, text/html)
2025-01-26 17:29 UTC, ^m'e
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ^m'e 2025-01-26 17:28:18 UTC
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.
Comment 1 ^m'e 2025-01-26 17:29:31 UTC
Created attachment 198776 [details]
Example of pandoc-rendered table cell with comment

Example of pandoc-rendered table cell with comment.
Comment 2 Michael Warner 2025-07-14 13:37:26 UTC Comment hidden (off-topic)
Comment 3 Michael Warner 2025-07-14 13:38:21 UTC
Oh, sorry, I didn't notice that your bug was about Calc.