-
Notifications
You must be signed in to change notification settings - Fork 8
Rendering Issue on Bold/Italics/Strikethrough Followed By Text #7
Comments
Same thing happens with strikethrough:
renders as The only way I can find to get a space to render in between the words is
which renders as
... And the same thing happens with:
which ALSO renders as italicsfollowed I thought at first it might be a bug in Markdown-It, but their demo site at https://markdown-it.github.io/ handles these correctly. |
I think I see the problem, but fixing it is over my head (for the moment). In wrapper.js, you call
The output from that is correct. The space is still present. e.g. Output is something like:
When you call this:
with " and a space" in node.textContent, there is a leading space. But for a text node, after calling that routine, children[0] never has a leading space, and that drops necessary leading spaces. I don't fully understand your code, but changing the try block in tiddlify to look like this has fixed the dropping of necessary spaces.
|
Thanks for looking into this in so much detail! It's a busy week for me but I'll play with this on Sunday |
It also fails on linksfollowed by text. |
@kleinfelter -hacked- wrote:
If you change the hack to an educated guess (I didn't go through thorough testing for all scenarios), you could just re-add the leading space:
|
Even fancier, because mixing Markdown and TiddlyWiki syntax doesn't work in the above solution:
I added a function that recursively looks for the first text node, adds a space and then returns:
It should be called after all the markdown and wiki parsing on the resulting
|
Found another issue: macros don't work. Apparently those aren't picked up by the Wiki parser. Giving up on fixing this, sorry. |
This patch makes MarkdownParser rely on WikiParser to parse WikiText instead of hackish low-level recursive code previously encapsulated in tiddlify() function. Addresses anstosa#7.
Manually applied cb9d404 patch to my work tiddlywiki instance and everything seems to be working okay. |
@nullrend, macros won't work. |
This patch makes MarkdownParser rely on WikiParser to parse WikiText instead of hackish low-level recursive code previously encapsulated in tiddlify() function. Addresses anstosa#7.
Both of the following lose the space between 'first' and 'second'. I see that you support two slashes for italics. GFM also supports the asterisk form per https://guides.github.com/features/mastering-markdown/
These should render as:
first second
first second
first second
but they render as:
firstsecond
_first_second
firstsecond
I see that you used this markup successfully at your demo site, but only as single-line items. This is a problem at your demo site too, if you add a space and text after the italicized items.
Interestingly, it also consumes multiple spaces and even
The text was updated successfully, but these errors were encountered: