mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-05-17 19:02:18 +00:00
8d9dc0cd29
* markdown: Don't emit paragraph tags when a paragraph is "tight". Motivation: Since the upgrade to remarkable.js (#3876), lists are rendered as HTML like this: ``` <ul> <li><p>One</p></li> <li><p>Two</p></li> <li><p>Three</p></li> </ul> ``` The paragraph nodes insert blocks that break the visual flow of the list and are unexpected e.g. compared to WikiText markup's rendering of a bulleted list. Solution: remarkable.js annotates certain paragraph nodes as "tight", and in the bulleted list case, the paragraph nodes wrapping the text of each list item are marked tight. remarkable uses the tight property to [elide paragraph tags in its renderer](https://github.com/jonschlinkert/remarkable/blob/58b6945f203ca7a0bb5a0785df90a3a6a8b9e59c/lib/rules.js#L136-L142). This change implements the equivalent logic in TiddlyWiki's markdown rendering: If a paragraph is marked tight, then we elide the `<p>` tag wrapping its children. * Use ES5 Array.concat instead of ES6 spread operator.