openstudyroom
openstudyroom copied to clipboard
gobans in forum post preview
Having a goban shown on previewing forum post with js would be great.
What did I do so far:
-
Changed bootstrap-markdown.js to add a callback
afterPreview. (here) -
Call bootstrap-markdown from js with options:
onPreviewwe call our shortcode.js thing to parse and translate[goban][/goban]tags into<div data-wgo=sgf>htmlafterPreviewwe call wgo.js to load a goban for each<div data-wgo=sgf>element.
It works.
The issue is we built shortcode.js to load wgo from html. It means we add attr such as data-wgo, data-wgo-move data-wgo-onkifuloaded to add options (see wgo doc).
And now we need to translate those data-wgo attr to js options.
Sounds a real pain.
I see 2 ways:
- We reformat shortcode.js to load everything on js(not using data-wgo html attributes).
- We find a way to call that js function from wgo.js.