Comments (10)
can you give me an example of the spoiler tag? with all the possible attributes and content?
from bbcode-to-markdown.
it's simply [spoiler]
and [/spoiler]
, no other attributes, but the content inside can be pretty much anything
from bbcode-to-markdown.
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.
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.
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.
yea, i guess that's possible. I mean, >!
is still valid html
from bbcode-to-markdown.
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.
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.
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.
published [email protected]
from bbcode-to-markdown.
Related Issues (9)
- BBCode Conversion loosing some tag HOT 2
- crash when converting a post with JavaScript in it HOT 1
- Text after '<' character is lost HOT 9
- Whitespaces before bbcode closing tag cause improper rendering of markdown HOT 4
- [b][url] tags not converting HOT 1
- run this on all existing nodebb posts content! HOT 1
- Quote names not showing up correctly after 1f21f5fb9f24808dc2c7bddff4d0b5750a675714 HOT 3
- support [quote user="name"] syntax
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbcode-to-markdown.