Open YellowAfterlife opened 1 year ago
Hi, thank you for the mention. I understand the problem you claim, but as you know, neither md2bb nor md2bb-web is actively maintained. I think it's possible to fork the library and add regular expressions, but I'm not sure if it's worth it. (I remember having trouble building when I tried that before)
Nowadays, I think creating a library that outputs steam bbcode as a markedjs plugin would be highly scalable and performant, but unfortunately I don't have the time or mental space to start doing it right now.
Therefore, we will put this issue on hold for now. Thank you for your interest.
By the way, below I discovered some new ones that do the same thing, although they weren't made by me. If it seems to solve your problem, try using:
I did also look at MarkdownToBB, which has its ups and downs.
However, I also came to a realization that trying to convert Markdown to BB Code with regular expressions has inherent limitations (e.g. all 3 tools handle multi-line list items variously incorrectly because that's not an easy thing to catch with a regular expression) so I wrote a userscript that generates BB Code by traversing DOM that was generated from Markdown, and that works better for my purposes
Firstly, thank you (and tenmihi) for doing this - thought I'd have to write a pile of regex myself.
1. Steam secretly supports two more header sizes and non-secretly supports horizontal rules,
But md2bb doesn't.
Hypothetically this is a matter of adding
to md2bb.js, but I was not able to verify this due to my limited familiarity with the matter
What I have tried
``` npm run build > md2bb-web@1.0.0 build > parcel build src/index.html √ Built in 430ms. dist\script.2c6b4f0f.js.map 12.75 KB 3ms dist\script.2c6b4f0f.js 6.09 KB 255ms dist\index.html 1.05 KB 2ms dist\style.4383ad0b.css.map 500 B 2ms dist\style.4383ad0b.css 204 B 7ms ``` ``` npm run start > md2bb-web@1.0.0 start > parcel src/index.html Server running at http://localhost:1234 | Building css-loader.js...Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db √ Built in 609ms. Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db ``` Upon opening the page: ``` Uncaught TypeError: Super expression must either be null or a function, not object _inherits http://localhost:1234/script.221c08a2.js:218 Md2bb http://localhost:1234/script.221c08a2.js:221 parcelRequire<["../node_modules/md2bb/index.js"]< http://localhost:1234/script.221c08a2.js:305 __webpack_require__ http://localhost:1234/script.221c08a2.js:151 parcelRequire<["../node_modules/md2bb/index.js"]< http://localhost:1234/script.221c08a2.js:194 parcelRequire<["../node_modules/md2bb/index.js"]< http://localhost:1234/script.221c08a2.js:197 webpackUniversalModuleDefinition http://localhost:1234/script.221c08a2.js:124 parcelRequire<["../node_modules/md2bb/index.js"]< http://localhost:1234/script.221c08a2.js:131 newRequire http://localhost:1234/script.221c08a2.js:47 localRequire http://localhost:1234/script.221c08a2.js:53 parcelRequire<["script.ts"]< http://localhost:1234/script.221c08a2.js:331 newRequire http://localhost:1234/script.221c08a2.js:47 parcelRequire http://localhost:1234/script.221c08a2.js:812. `code` should probably be ```code```
As the
[code]
tag is a code block, not inline code.I already run the output through a userscript upon pasting into Steam (to turn
![](img.png)
into[previewicon=31285016;sizeOriginal,inline;img.png][/previewicon]
) so I have simply added these bits in there. No rush.