Looks like Laravel.io uses this package: https://github.com/michelf/php-markdown
Markdown Editors
What are people using to implement markdown in Laravel apps at the moment? I have seen a few, but want something quite simple, basic that just lets me throw some MD into text areas.
interesting, will take a look.
thanks
I'm using vtalbot/markdown.
I've never understood this Markdown thing that's growing everyday, so I wish you can help me with it.
I get it's easy, you don't have to press buttons, you don't have to leave the keyboard, it works easy with plain files you upload those files to the server and they work, etc...
But it's something users have to memorize. It's something technical. It's a new UX experience that's not what user expect (word/pages style editor aka WYSIWYG).
I understand it makes a perfect fit for this web. It fits perfectly with Jeffrey working style. But I don't understand why people are pushing regular non technical users into using MD or Github's enhanced MD.
Am I missing something?
I tend to agree that markdown only makes sense if the users already embrace it outside of the context of the site.
I am using ACE as well as EpicEditor in one of my projects, but will change that if there are better alternatives. :)
MD is a representation of how you would logically structure a document if all you had to work with was text.
For instance putting a - then a space before list items, a heading with a line break then a few dashes, making text more noticeable by wrapping it with * etc
If I were building a regular client's app, I wouldn't bother with Markdown. But, for a developer-specific site, it's a no-brainer. Takes five minutes to memorize the symbols.
For client's app, I use Summernote, which is great!
the people using this app are actually developers who are submitting work they have done, so in that context I think it fits quite well, what I wanted to steer clear of is things like TinyMCE, I still have bad dreams about that thing.
Wow thanks a lot @foxted. Probably one of the nicest WYSIWYG editors I've seen in a while, but does it support markdown? Because a WYSIWYG Markdown editor would be probably the best thing in the world, merging the gap between developer and user.
Hey @jeffreyway did you take steps towards stripping HTML people might add in (inside and outside of code fences)?
This has been an issue I've worried about but haven't bothered looking into yet :D
Since Markdown allows arbitrary HTML, you can conceivably strip_tags on when there's input, but I think you need to find a way to ignore HTML tags that might be in code brackets...
<strong>this is html inside of code fence</strong>
(Looks like you figured it out in any case!)
@fideloper probably just escapes all HTML characters, then make it go though the markdown parser.
@CraftThatBlock I don't think it's that simple, because HTML in the code fence would also get stripped before going through the markdown parser.
@fideloper - Once Markdown converts your reply, it'll turn all HTML tags within pre tags into their entity counterparts. So, that allows me to then do another sweep and strip out any unwanted tags that the user might have manually added (though I allow some).
class ReplyParser {
/**
* @param $body
* @return mixed
*/
public function parse($body)
{
$body = $this->stripTags($body);
$body = $this->stripStyles($body);
$body = $this->createHyperlinks($body);
$body = $this->createLaracastsProfileLinks($body);
return $body;
}
// ...
It probably still needs some tweaking, but we'll see.
@fideloper I meant a WYSIWYG editor like TinyMCE, CKeditor, Textbox.io, etc, that has actually /good/ markdown, and simply and stylish like Summernote.
Never yet found a good one.
@JeffreyWay Any chance we can see your entire ReplyParser class?
I am building a site that needs the same sort of functionality and would like to compare to see if I can improve what I have.
@akael - Sure, I can send it through, when I'm back at my main work computer. It's mostly a few methods containing regular expressions, to filter out all the stuff I don't want.
@JeffreyWay Thank you, I will look forward to it.
I missed a lot lately :/ @CraftThatBlock Yes, markdown in summernote would be awesome, apparently some other folks would love it !!
@JeffreyWay, I'd also like to see that class! I'll be doing something similar within' the next week or two and it'd be nice to not have to reinvent the wheel. :)
Also, is there a reason you went with EpicEditor client-side instead of markdown-js or sending an AJAX request to parse it server-side?
There's the Pagedown Bootstrap editor that works just like the Stackoverflow editor. It's nice because it shows a live preview beneath using the pagedown library.
It's purely client-side so you can save raw markdown on your backend and parse it to html when it's rendered - either client or server side.
@JeffreyWay - Any chance you could post the regex that is used in that example?
We use Redactor for work projects, which is licensed (and what Summernote is based on). It's clean, looks good, and works well. Unfortunately, no markdown support built into it, though.
Hi friends, anyone of you are using vtalbot/markdown package within Laravel 5?
@JeffreyWay you are using that package? In the composer.json it specifies the laravel 4 version as a requirement. Could you recommend me this package for L5 projects or do you recommend me another package?
Thanks in advanced.
@codeatbusiness vtalbot/markdown is a wrapper of michelf/php-markdown so feels free to create your own wrapper for laravel 5
@codeatbusiness Last time, Jeffrey said that he switched to the league/commonmark
Many thanks both of you. I have switched to league/commonmark too and it works fine.
Thanks in advanced.
How do you guys or @JeffreyWay add the highlight to the MD.????
Please or to participate in this conversation.