So I noticed one slightly annoying problem - when someone quotes the poem, the 'soft line breaks' are not honored within the quote.
It looks as though that's a result of the way the quotes addon is written. Specifically, these lines (270 to 275 in quotes.js):
case 'Markdown':
case 'Display':
case 'Text': // Plain
var Append = '> '+Data.Quote.authorname+" said:\n";
Append = Append+'> '+Data.Quote.body.replace(/(\n)/g, "$1> ")+"\n";
break;
It seems like I need to put a couple more blank spaces in there to get the soft line breaks to show in quotes, but I'm not 100% sure where. Just before the $1?
Yes, that should work (you'll have to try it out to be sure, though).
Maybe you could even put it in the plugin with
public function PostController_Render_Before($Sender) {
$Sender->RemoveJsFile('quotes.js');
$Sender->AddJsFile('quotes.js', 'plugins/MarkdownMarkup');
}
and
public function DiscussionController_Render_Before($Sender) {
$Sender->RemoveJsFile('quotes.js');
$Sender->AddJsFile('quotes.js', 'plugins/MarkdownMarkup');
}
True, if someone were using this on a forum where the users had major markdown kung-fu, I definitely wouldn't recommend it.
In my case, I've got people who are doing victory laps if they can correctly format a bullet list. I'm leading them on the first baby steps of "future proof your writing by using plain text."
I've decided not to screw with the quotes.js - it's enough of an edge case (and it doesn't misbehave all the time, even now) that I don't want to screw with it - it's a good opportunity for them to learn how to do a line break properly by inserting the two spaces themselves. Baby steps...
@Bleistivt said:
There was a change in master some time ago to respect soft linebreaks in Markdown, but it was reverted
You are following closely I made an error when implementing soft line breaks and upgrading to latest Markdown library and was asked to revert the change until I have time to do it properly (which will be before 2.3).
@Bleistivt said:
I'd guess they removed it because it broke existing comments formatting and the behaviour was unexpected for users.
No, this is absolutely the default behavior I want in our Markdown implementation. It isn't just poets - it drives everyone nuts to not have easy single line breaks when posting on a forum. It also makes quoting hit or miss - without the extra line break, your reply gets wrapped into the quote. The issue is strictly the unrelated issues I introduced with my first attempt that needed to be undone ASAP (e.g. code formatting had extra line breaks added).
Hey guys, I've built on the MarkdownMarkup plugin posted earlier in this thread to get it to work with previews and messages as well in case anyone's interested: https://github.com/29th/vanilla-markdownmarkup
Comments
that is very awesome p !!
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
I like your badge better, just wanted to try my hand at it so to speak.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
That design looks very cool for a logo too , for a witch burning cult, or the Torch movement, or even Sports company.. Sports team the lightning Torch
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
is it too late to copyright, so I can collect royalties?
It could also double as a "smote" badge.
as in "he smote thee"
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
No, but it only takes effect as soon as someone makes a mint from it. Then you have to fight them in court and prove you thought of it first....
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
You guys are great.
So I noticed one slightly annoying problem - when someone quotes the poem, the 'soft line breaks' are not honored within the quote.
It looks as though that's a result of the way the quotes addon is written. Specifically, these lines (270 to 275 in quotes.js):
It seems like I need to put a couple more blank spaces in there to get the soft line breaks to show in quotes, but I'm not 100% sure where. Just before the $1?
Yes, that should work (you'll have to try it out to be sure, though).
Maybe you could even put it in the plugin with
and
...to overwrite the original quotes.js.
Let's just hope it has a higher precedence...
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
html is integral to markdown therefore any solution must be mindful of this. The last thing you want is out of place br/p tags all over.
grep is your friend.
You should consider why they removed that code from the core in the first place...
grep is your friend.
I'd guess they removed it because it broke existing comments formatting and the behaviour was unexpected for users.
What this plugin does is basically just like someone went and added two spaces to the end of every line.
HTML will ignore the extra whitespace and Markdown should not add an extra break before a new paragraph.
Still, it should be tested extensively, especially markdown tables.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Yes your solution is better, the other solution added br directly which is probably why they took it out.
grep is your friend.
True, if someone were using this on a forum where the users had major markdown kung-fu, I definitely wouldn't recommend it.
In my case, I've got people who are doing victory laps if they can correctly format a bullet list. I'm leading them on the first baby steps of "future proof your writing by using plain text."
I've decided not to screw with the quotes.js - it's enough of an edge case (and it doesn't misbehave all the time, even now) that I don't want to screw with it - it's a good opportunity for them to learn how to do a line break properly by inserting the two spaces themselves. Baby steps...
You are following closely I made an error when implementing soft line breaks and upgrading to latest Markdown library and was asked to revert the change until I have time to do it properly (which will be before 2.3).
No, this is absolutely the default behavior I want in our Markdown implementation. It isn't just poets - it drives everyone nuts to not have easy single line breaks when posting on a forum. It also makes quoting hit or miss - without the extra line break, your reply gets wrapped into the quote. The issue is strictly the unrelated issues I introduced with my first attempt that needed to be undone ASAP (e.g. code formatting had extra line breaks added).
That's great news. I'd always rather be relying on core functions.
In my continuing quest to be more transparent I've added this as an issue against 2.3: https://github.com/vanilla/vanilla/issues/2045
@linc have you considered switching to parsedown?
It seems to be a lot faster and has an option to enable normal linebreaks built in (setBreaksEnabled).
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
We have considered switching libraries entirely, yes; I'll add that as a reminder on the task. I don't think we've made a final decision yet.
Hey guys, I've built on the
MarkdownMarkup
plugin posted earlier in this thread to get it to work with previews and messages as well in case anyone's interested: https://github.com/29th/vanilla-markdownmarkupLook here: https://github.com/vanilla/vanilla/blob/2.1/applications/vanilla/views/discussion/helper_functions.php#L72-73
I think you should avoid
$Sender->EventArguments['Object']
Soft line breaks has been implemented in core.