Open pmario opened 2 years ago
For the output html, we only need to distinguish:
Here an example of needed output:
<ul>
<li>list item one</li>
<li>list item two with
<pre><code>block of
code</code></pre></li>
<li>list item <br>three</li>
</ul>
Just a crazy idea would be a especial parser rule for how the single carriage-return are parsed.
For line break it detects the single carriage-return and it changes them for a <br>
element.
@@mode=block;
hello
world
@@
output:
<p>hello<br>
world</p>
The hard part would be how it would work with the block elements. The key would be the single carriage-return following of a wikitext that will parsed as block element.
@@mode=block;
this is a ''' block of code ''' @@
Note: The `'''` should be **triple backticks** in TiddlyWiki
output:
block of
code
or adding a (unnecessary) `br` element
block of
code
---
An alternative way to activate this special break rule could be @@+br;
The syntax started with @@+
could be used for new especial rules which are a applied to text inside of them. Just another crazy idea.
The mode=block
rule is intended to be used like the mode=block for the transclusion-widget.
Try the following code. .. The heading will not be detected, because the parser is in "inline-mode" ... That's why we would need a mode=block
*@@.test some text
!! heading in the next line
@@
The linebreak "problem" can be solved with code at the other post: https://github.com/Jermolene/TiddlyWiki5/issues/6905#issuecomment-1215042576
We are talking about the same, "inline-mode" to parse in "block-mode", the result of parsing will be a block element. The difference is the syntax of the trigger. Also the utility class for linebreak can be used as trigger.
Also the utility class for linebreak can be used as trigger.
IMO it doesn't need special treating in the parser because it can be solved with CSS
From: [IDEA] multiline syntax for list wikitext elements #6905
In context of styled blocks
Styled blocks already allow several lines of class and style definitions.
It may be possible to extend it like this
Just and idea, but I think it would be possible and is backwards compatible. .. The only problem is, that it's a bit of an "overload" ...