openstudyroom icon indicating copy to clipboard operation
openstudyroom copied to clipboard

gobans in forum post preview

Open climu opened this issue 8 years ago • 1 comments

Having a goban shown on previewing forum post with js would be great.

climu avatar Nov 07 '17 16:11 climu

What did I do so far:

  • Changed bootstrap-markdown.js to add a callback afterPreview. (here)

  • Call bootstrap-markdown from js with options:

    • onPreview we call our shortcode.js thing to parse and translate [goban][/goban] tags into <div data-wgo=sgf> html
    • afterPreview we 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:

  1. We reformat shortcode.js to load everything on js(not using data-wgo html attributes).
  2. We find a way to call that js function from wgo.js.

climu avatar Nov 07 '17 17:11 climu