summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-10-13 23:00:31 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-10-14 19:57:09 +0200
commit5e55297ee01b20c9cd4119a6e5757a0b4aafd620 (patch)
tree59096be0828794fd4d078510938cd74d3b8f475a /tests/auto
parent74e634d82ced894f235526c7c2b6ac476c93e2bc (diff)
Markdown writer: indent fence consistent with code block
- Under a list item, we've been indenting code blocks: ``` int main() ... ``` - But it's also ok *not* to indent (and github handles that better): ``` int main() ... ``` - There was a bug that when the code is not indented, the fence would be indented anyway: ``` int main() ... ``` and that was not OK, neither for md4c nor for github. Now with this change, either way is rewritable: you can read markdown into QTextDocument, make small edits and write it back out again, with the indentation being preserved (the code block is either part of the list item, thus indented, or else it's outside the list completely). Pick-to: 6.2 Task-number: QTBUG-92445 Change-Id: I5f51899e28ba9f09b88a71e640d9283416cce171 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md b/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md
index 54e3f25afa..b3539167ab 100644
--- a/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/listsAndCodeBlocks.md
@@ -22,3 +22,10 @@
- still didn't fix it, expecting a breakthrough any day now
- some sort of miracle
- profit!
+- Alternatively we can have a non-indented fenced code block under a list item:
+
+```qml
+import QtQuick
+Text { text: "hello world" }
+```
+- but that means the code block is not part of the list item.