Would like to use Markdown formatting, but with one feature borrowed from BBCode input formatter
Hi all,
To get you caught up, I'm on 2.1.1 stable, default template, and I'm using no text editing addon of any kind at this point, because my users are... bad at following directions - the cledit wysiwyg editor I was using was simply too much power in the hands of the irresponsible, and stuff like buttonbar (which puts the formatting out where the author can see it) simply terrifies everyone.
SO: no text editing addon, and my input formatter in config is set to Markdown (just because I had to disable editing tools, there's no reason people who know markdown need to suffer).
This works great, except for one problem: poets.
(As a matter of fact, 98% of the problems I have with my newly-live forum stem from the poetry department. Goddamn.)
Anyway, the poets need soft line breaks, because they're all posting poetry for critique and, using the Markdown input format, all the soft line breaks are being ignored. I've told them to just end those lines with two spaces, but christ-on-sale you'd think I'd asked them to climb a mountain. (And the eighty-six-year-old faculty guy has muttered about resigning. Again.)
Solution! I can switch the input to BBCode, which pays attention to soft line breaks.
Problem! Losing Markdown to enable BBCode makes me very sad.
So, what I really want - what I think would solve most of my problems - is Markdown input formatting, but with the BBCode inputformatter's ability not-ignore soft line breaks.
Is this possible? (Yes, I know it will anger Gruber and the rest of the Markdown gods, but at this point I will bear their wrath if I can do this.)
Comments
what about telling them to put their poetry within code tags
highlight click code.
or poets category could have a different input formatter.
of individuals could choose formatter the same way you changed custom theme css.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
You could even duplicate the code tag button, and name it verse, or something, to make them feel really special.
I heard this on the radio recently (paraphrase, cant quite remember it exactly.)
Eh?
Tell me more about this wizardry.
There was a change in master some time ago to respect soft linebreaks in Markdown, but it was reverted:
https://github.com/vanilla/vanilla/commit/8c7261278c05f31af23326b4fdb1effa11289302
But if you don't want to modify the core...
Try this and tell me if it works:
edit: Be sure you have 2 spaces before the $1 (when i coped this code they got trimmed for some reason)
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
thats what I was thinking too! (didn't mention it, but my thought were aligned with you).
but will see if Bleistivt's change is what Doyce wants.
probably via custom plugin.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Okay, I put together an addon with the code from @bliestivt. Looks like so:
I can enable the plugin okay, and regular markdown is working, but when I post in something with a bunch of soft line breaks, it continues to ignore them.
Did I miss something? What should be happening?
@DoyceT on my setup it works
Have you double checked for the double whitespace?
It always gets lost, when I copy it from here.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Yeah. I thought (hoped) that might be it, but what you see up above is a straight copy-paste from my site - the two spaces before the $1 are there.
This is a zip of the addon exactly as it is on my site.
Weird, for me it works on a fresh copy of 2.1.1
What in your config for Garden.InputFormatter ?
If it's empty, try changing it to Markdown.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Well...
I had the input formatter set to Markdown.
I deleted the line entirely to go back to default.
Then I set the Input Formatter back to Markdown.
And now...
The addon works (it's reflecting line breaks), but none of the other Markdown formatting is being processed.
... and then I refreshed the forum discussion where I'm testing all this.
Now the markdown formatting works, and it's back to not processing the line breaks. WTAF.
OhmygodI'msodumb.
Seriously. I'm so dumb.
I disabled the plugin and forgot to turn it back on. Holy cats I'm stupid.
I need a "shame" badge.
It's all working now. You guys are great.
@vrijvlinder could fashion one up. lol
you'll have to settle for this now
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Great! You could add it to the addon repo, and maybe add
to the function, so it doesn't clash with other InputFormatters.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
I'd be happy to do both those things.
I don't want to screw up those extra lines, so if you look at that paste-in of the addon I shared above, where would those two lines go? Insert above line 13?
yes.
or with Lord Bracko taking precedence
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
t's kind of crappy on short notice... but shame is crappy by default ...
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
This is a refined version, you can use this cool tool to make any badges you want for free
http://www.onlinebadgemaker.com/3d-badge-maker
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
self-shame badge the lightning bolts signify the static electricity when you face-plant your head into the palm of your hand, and the flames signify release of bad energy at the moment of impact.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.