Hi Bimlas

> I'm working on a parser plugin to render Asciidoctor formated text.

Great!

> The plugin is using Asciidoctor.js 
> (https://github.com/asciidoctor/asciidoctor.js) and basically works, but the 
> content of the tiddler is the HTML code itself instead of the correctly 
> rendered text. For example if I creating a new tiddler with the content
> 
>   *bold* _italic_
> 
> then it's transforming to
> 
>   <div class="paragraph"> <p><strong>bold</strong> <em>italic</em></p> </div>
> 
> when I save the tiddler. (screenshot: https://i.imgur.com/aHtHneJ.png)
> 
> As I looked in to the Markdown parser plugin, it seems that the Markdown.js 
> returns a HTML tree (thanks to JsonML). I assume my plugin should do the 
> same, but there is no option for this in Asciidoctor.js. How can I achieve 
> this? Is there a builtin method to transform HTML nodes to HTML tree or 
> should I use JsonML?

Your parser can return raw HTML by returning an object like this:

{type: "raw", html: <string>}

The downside of returning raw HTML is that it makes it harder to support 
features like native TW links.

Best wishes

Jeremy

> 
> To try out:
> 
> * Clone https://github.com/bimlas/tiddlyWiki5/ and check out 
> `asciidoctor-plugin` branch, or simply download 
> https://github.com/bimlas/TiddlyWiki5/archive/asciidoctor-plugin.zip
> * Run `bin/serve.sh editions/full`
> * Press the second Markdown icon in the right panel (move the mouse over it, 
> the tooltip should be related to Asciidoctor)
> * Write `*bold* _italic_` in it and save the tiddler
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywikidev 
> <https://groups.google.com/group/tiddlywikidev>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywikidev/e223b36a-353e-43c2-aaef-72b72de34d92%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywikidev/e223b36a-353e-43c2-aaef-72b72de34d92%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/D3F7DC53-7CCC-42C1-80BA-58E49361F27C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to