Skip to content

Commit

Permalink
use safeHtml to avoid escape double quote
Browse files Browse the repository at this point in the history
  • Loading branch information
jackliusr committed Apr 20, 2024
1 parent ac7b7bd commit aa6cb69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content/posts/2024/04/jsmind.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ tags:

I used mindmap in my logseq, however it show left to right side, the start node is always at the left side. I prefer to have the main concept shown in the center. Jsmind is the perfect fit after I saw its demos. Here is I create a shortcode in my hugo and try to create a demo mindmap using jsmind.

{{< jsmind >}}{"meta":{"name":"example","author":"hizzgdev@163.com","version":"0.2"},"format":"node_array","data":[{"id":"root","isroot":true,"topic":"jsMind"},{"id":"easy","parentid":"root","topic":"Easy","direction":"left"},{"id":"easy1","parentid":"easy","topic":"Easy to show"},{"id":"easy2","parentid":"easy","topic":"Easy to edit"},{"id":"easy3","parentid":"easy","topic":"Easy to store"},{"id":"easy4","parentid":"easy","topic":"Easy to embed"},{"id":"open","parentid":"root","topic":"Open Source","direction":"right"},{"id":"open1","parentid":"open","topic":"on GitHub"},{"id":"open2","parentid":"open","topic":"BSD License"},{"id":"powerful","parentid":"root","topic":"Powerful","direction":"right"},{"id":"powerful1","parentid":"powerful","topic":"Base on Javascript"},{"id":"powerful2","parentid":"powerful","topic":"Base on HTML5"},{"id":"powerful3","parentid":"powerful","topic":"Depends on you"}]}{{< /jsmind >}}
{{< jsmind >}}"meta":{"name":"example","author":"hizzgdev@163.com","version":"0.2"},"format":"node_array","data":[{"id":"root","isroot":true,"topic":"jsMind"},{"id":"easy","parentid":"root","topic":"Easy","direction":"left"},{"id":"easy1","parentid":"easy","topic":"Easy to show"},{"id":"easy2","parentid":"easy","topic":"Easy to edit"},{"id":"easy3","parentid":"easy","topic":"Easy to store"},{"id":"easy4","parentid":"easy","topic":"Easy to embed"},{"id":"open","parentid":"root","topic":"Open Source","direction":"right"},{"id":"open1","parentid":"open","topic":"on GitHub"},{"id":"open2","parentid":"open","topic":"BSD License"},{"id":"powerful","parentid":"root","topic":"Powerful","direction":"right"},{"id":"powerful1","parentid":"powerful","topic":"Base on Javascript"},{"id":"powerful2","parentid":"powerful","topic":"Base on HTML5"},{"id":"powerful3","parentid":"powerful","topic":"Depends on you"}]{{< /jsmind >}}


2 changes: 1 addition & 1 deletion layouts/shortcodes/jsmind.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div id="{{$id}}"></div>
<script type="text/javascript">
var mind = { {{ .Inner }} };
var mind = { {{ .Inner | safeHTML }} };
var options = {
container:'{{$id}}',
editable:true,
Expand Down

0 comments on commit aa6cb69

Please sign in to comment.