retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.88k stars 196 forks source link

HTML parser doesn't respect list item value attribute #610

Closed mxamber closed 1 year ago

mxamber commented 1 year ago

In HTML, li list item elements in ol ordered lists can use the value attribute to skip numbers. Since Markdown has no equivalent, but writing raw HTML into .md files is commonly accepted (and supported by ReText), using <li value=n> is the only way to achieve numbered list with skipped numbers.

However, although such HTML is exported correctly using the HTML export, it is neither displayed correctly nor exported correctly using the built-in print dialog.

Here is an example code snippet:

## My subsection

Here goes the list. It looks like this:

<ol>
  <li>One</li>
  <li>Two</li>
  <li value=5>Five</li>
</ol>

The above code should produce a 1-2-5 list, which it does in the HTML export, but does not in the live preview, static preview, or print export.

mitya57 commented 1 year ago

Thank you for your report.

QTextEdit is not a full-fledged HTML engine, it only supports a subset of HTML which is documented on this page. Unfortunately, value attribute of li elements is not supported.

I suggest you to use the WebEngine (Chromium) renderer which can be enabled from the Edit menu.