feat: Switch to github flavor markdown to render checkboxes
Also fixes a bug where a room pill was not rendered as link.
This commit is contained in:
parent
e4691d1636
commit
f3bb654ac2
|
|
@ -213,7 +213,7 @@ String markdown(
|
|||
}) {
|
||||
var ret = markdownToHtml(
|
||||
text.replaceNewlines(),
|
||||
extensionSet: ExtensionSet.commonMark,
|
||||
extensionSet: ExtensionSet.gitHubFlavored,
|
||||
blockSyntaxes: [
|
||||
BlockLatexSyntax(),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ void main() {
|
|||
);
|
||||
expect(
|
||||
markdown('https://matrix.to/#/#fox:sorunome.de'),
|
||||
'https://matrix.to/#/#fox:sorunome.de',
|
||||
'<a href="https://matrix.to/#/#fox:sorunome.de">https://matrix.to/#/#fox:sorunome.de</a>',
|
||||
);
|
||||
expect(
|
||||
markdown('Hey @sorunome:sorunome.de:1234!'),
|
||||
|
|
@ -221,5 +221,14 @@ void main() {
|
|||
'<p>The first<br/>codeblock</p><pre><code class="language-dart">void main(){\nprint(something);\n}\n</code></pre><p>And the second code block</p><pre><code class="language-js">meow\nmeow\n</code></pre>',
|
||||
);
|
||||
});
|
||||
test('Checkboxes', () {
|
||||
expect(
|
||||
markdown(
|
||||
'- [ ] Check 1\n- [x] Check 2\n- Normal list item',
|
||||
convertLinebreaks: true,
|
||||
),
|
||||
'<ul class="contains-task-list"><li class="task-list-item"><input type="checkbox"></input>Check 1</li><li class="task-list-item"><input type="checkbox" checked="true"></input>Check 2</li><li>Normal list item</li></ul>',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue