akhoury / bbcode-to-markdown Goto Github PK
View Code? Open in Web Editor NEWnode module to convert bbcode to markdown
License: MIT License
node module to convert bbcode to markdown
License: MIT License
Has to do with html encoding.
Test:
{
"raw": "[quote="aziz"]<br />test<br />[/quote]<br /><br />hey!",
"html": "<small>@aziz:</small><br><blockquote><br />test<br /></blockquote><br /><br />hey!",
"md": "@aziz:\n\n> test\n\nhey!"
}
Result:
'<small>@":</small><br><blockquote><br />test<br /></blockquote><br /><br />hey!'
!=
'<small>@aziz:</small><br><blockquote><br />test<br /></blockquote><br /><br />hey!'
/home/ubuntu/workspace/test/test.js:8
throw JSON.stringify(sample, null, 2) + ", " + what + "() Failed, " + i;
^
{
"raw": "[quote="aziz"]<br />test<br />[/quote]<br /><br />hey!",
"html": "<small>@aziz:</small><br><blockquote><br />test<br /></blockquote><br /><br />hey!",
"md": "@aziz:\n\n> test\n\nhey!"
}, bbcodeToHTML() Failed, 6
can you help me to run this on all nodebb posts and update them ?
it's enough if i can run it on terminal, plugin is not necessary!
Whitespaces just before a closing tag should be moved after that tag.
Minimal example
This should be [b]bold [/b], but it is rendered as **bold ** ,
But if space is extracted and moved: **bold** , it will be rendered properly.
Input:
HTA app is currently this:
```
<HTML>
<HEAD>
<HTA:APPLICATION
ID="oHTA"
APPLICATIONNAME="myApp"
ICON="http://charlatanshanty.com/icon.ico">
<script type="text/javascript">
function show()
{
alert("show alert");
}
</script>
</head>
<body onload="show()">
</body>
</html>
```
Expected output:
(unchanged)
Actual output:
HTA app is currently this:
\`\`\`
\`\`\`
TypeError: Cannot read property 'implementation' of undefined
at Function.getListeners (/home/ben/discoconvert/akhoury-nodebb-plugin-import/node_modules/jsdom-nogyp/lib/jsdom/level2/events.js:176:74)
at Function.dispatch (/home/ben/discoconvert/akhoury-nodebb-plugin-import/node_modules/jsdom-nogyp/lib/jsdom/level2/events.js:192:40)
at Object.events.EventTarget.dispatchEvent (/home/ben/discoconvert/akhoury-nodebb-plugin-import/node_modules/jsdom-nogyp/lib/jsdom/level2/events.js:287:33)
at Object.DOMWindow.dispatchEvent (/home/ben/discoconvert/akhoury-nodebb-plugin-import/node_modules/jsdom-nogyp/lib/jsdom/browser/index.js:114:40)
at /home/ben/discoconvert/akhoury-nodebb-plugin-import/node_modules/jsdom-nogyp/lib/jsdom/browser/index.js:50:16
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickDomainCallback (node.js:389:13)
Minimal example:
A mathematical range breaks document <3, 5]
This text will be lost
Hey Aziz, almost same kind of dillemma as with the html-to-markdown
Just wanted to add the [spoiler] tag, but if you can point me in the right direction I can make a PR
Thanks!
Should be a trivial addition to https://github.com/akhoury/bbcode-to-markdown/blob/master/src/newBBCodeTags.js#L130
This is what Community Server used.
[b][url=http://www.example.com/example.mov]Foo Bar Zee (77.77MB)[/url][/b]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.