GithubHelp home page GithubHelp logo

Add spoiler tag about bbcode-to-markdown HOT 10 CLOSED

akhoury avatar akhoury commented on September 17, 2024
Add spoiler tag

from bbcode-to-markdown.

Comments (10)

akhoury avatar akhoury commented on September 17, 2024

can you give me an example of the spoiler tag? with all the possible attributes and content?

from bbcode-to-markdown.

bdharrington7 avatar bdharrington7 commented on September 17, 2024

it's simply [spoiler] and [/spoiler], no other attributes, but the content inside can be pretty much anything

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

i think it's already supported, as an ContentOnlyTag

see this line,
https://github.com/akhoury/bbcode-to-markdown/blob/master/newTags.js#L28

from bbcode-to-markdown.

bdharrington7 avatar bdharrington7 commented on September 17, 2024

Ok. Was that intended to just strip it out? I thought it would replace with markdown, like [b]bold[/b] would become **bold**. in a few of the tags I tested (including spoiler), the output was:

bbcode('[u]underline[/u]') //'underline'
bbcode('[vimeo]underline[/vimeo]') //'underline'

Could we make the spoiler tag output this to work with @psychobunny's spoiler plugin?

bbcode('[spoiler] something secret [/spoiler]') //  '>! something secret'

from bbcode-to-markdown.

bdharrington7 avatar bdharrington7 commented on September 17, 2024

Ah I see, you're converting to HTML first, and there's not really an equivalent translation. Wouldn't it be safe to convert straight to the quote md syntax?

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

yea, i guess that's possible. I mean, >! is still valid html

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

OR, we create custom html tag, like a <span original-bbcode-tag="spoiler">CONTENT</span> this way if someone want to just convert to HTML, it won't affect the HTML content, but the markdown converter can recognize it

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

so i decided on converting

[spoiler foo=bar]BAMM[/spolier]

To

<spoiler foo="bar">BAMM</spolier>

Which, as HTML, is not really valid, but the browser will be still display it as a text node.

Then in this plugin, we need to add support for <spoiler>
akhoury/html-md-optional_window#3

I just gotta brush up on coffeescript

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

basically adding anything in the simpleTags Array will be handled that way
https://github.com/akhoury/bbcode-to-markdown/blob/master/newTags.js#L8

from bbcode-to-markdown.

akhoury avatar akhoury commented on September 17, 2024

published [email protected]

from bbcode-to-markdown.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.