From feec6ef18fd44498ae87af99e217aafb54f10c77 Mon Sep 17 00:00:00 2001 From: btheado Date: Tue, 10 Sep 2024 06:48:14 -0400 Subject: [PATCH] Use testcase tiddlers for html examples (#8376) * Convert several html examples into testcase tiddlers * Convert html table exmaple into testcase tiddler --- .../testcases/HTML/BlockModeInHTMLTable.tid | 30 +++++++++++++ .../testcases/HTML/OpenTagBlankLine.tid | 23 ++++++++++ .../HTML/OpenTagBlankLineInBoldSyntax.tid | 22 +++++++++ .../HTML/OpenTagBlankLineInTableSyntax.tid | 22 +++++++++ .../testcases/HTML/OpenTagNoBlankLine.tid | 34 ++++++++++++++ .../WikiText parser mode_ HTML examples.tid | 45 +++---------------- 6 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid diff --git a/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid b/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid new file mode 100644 index 00000000000..f7050de7d5b --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid @@ -0,0 +1,30 @@ +created: 20240713164810184 +description: Block mode for table cells +modified: 20240713164810184 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/BlockModeInHTMLTable +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +Unlike the table wiki syntax, the less convenient ``, ``, `
` html tags can use a blank line +to get block mode punctuation regognised inside of table cells. ++ +title: Output + + + +
+ +* list item one +* list item two + + +|nested|table| +
++ +title: ExpectedResult + +

+ +
  • list item one
  • list item two
nestedtable

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid new file mode 100644 index 00000000000..0c14b05275a --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid @@ -0,0 +1,23 @@ +created: 20240622142425004 +description: Blank line after open tag +modified: 20240622144230258 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLine +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag allows block mode punctuation to be recognised ++ +title: Output + +
+ +* blank line after open tag allows +* block mode punctuation (i.e. this list) to +* be recognised +
++ +title: ExpectedResult + +
  • blank line after open tag allows
  • block mode punctuation (i.e. this list) to
  • be recognised
\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid new file mode 100644 index 00000000000..f6072bca48f --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid @@ -0,0 +1,22 @@ +created: 20240622144038465 +description: Blank line after open tag in bold syntax +modified: 20240622145114506 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLineInBoldSyntax +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag allows block mode punctuation to be recognised even when the html is embedded within inline punctuation (bold here). ++ +title: Output + +''
+ +* list item one +* list item two +
'' ++ +title: ExpectedResult + +

  • list item one
  • list item two

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid new file mode 100644 index 00000000000..0835c47bcf9 --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid @@ -0,0 +1,22 @@ +created: 20240622144753311 +description: Blank line after open tag in table syntax +modified: 20240622145056299 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLineInTableSyntax +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag cannot work when used inside table syntax since each row of a table must be all on one line ++ +title: Output + +|For a blank line after open tag|
+ +* list is recognised +* but the surrounding table row is not +
| ++ +title: ExpectedResult + +

|For a blank line after open tag|

  • list is recognised
  • but the surrounding table row is not
|

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid new file mode 100644 index 00000000000..e49fcabfbd1 --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid @@ -0,0 +1,34 @@ +created: 20240622143533021 +description: No blank line after open tag +modified: 20240622145145440 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagNoBlankLine +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +Block mode punctuation is not recognised when HTML open tag is not followed by a blank line ++ +title: Output + +
+* Open tag without a blank line means +* block mode punctuation (i.e. this list) will +* NOT be recognised. + +Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. + +This also is not a new paragraph. +
++ +title: ExpectedResult + +

+* Open tag without a blank line means +* block mode punctuation (i.e. this list) will +* NOT be recognised. + +Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. + +This also is not a new paragraph. +

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid b/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid index fc068e44eb4..8d54831087f 100644 --- a/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid +++ b/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid @@ -1,38 +1,20 @@ created: 20220122153235162 -modified: 20220122180508134 +modified: 20240713165558596 tags: [[WikiText parser mode transitions]] title: WikiText parser mode: HTML examples type: text/vnd.tiddlywiki -< - -* blank line after open tag allows -* block mode punctuation (i.e. this list) to -* be recognised - -">> +<> --- The open tag blank line "trick" also works inside of punctuation only recognised in inline mode (such as [[Formatting in WikiText]]): -< - -* list item one -* list item two -''">> +<> --- -< -* Open tag without a blank line means -* block mode punctuation (i.e. this list) will -* NOT be recognised. - -Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. - -This also is not a new paragraph. -">> +<> --- @@ -42,11 +24,7 @@ Adding a blank link after an open tag within a table cell causes the row to span <> -< - -* list is recognised -* but the surrounding table row is not -|">> +<> --- @@ -58,15 +36,4 @@ Note that <<.wlink MacroCallWidget>> does not have a similar <<.attr mode>> attr --- -The less convenient ``, ``, ` -
` html tags can be used as a foolproof way to get [[block mode|Block Mode WikiText]] punctuation recognised inside of table cells. - -< -
- -* list item one -* list item two - - -|nested|table| -
">> \ No newline at end of file +<> \ No newline at end of file