3 users online. Create an account or sign in to join them.Users
Markdown Text Formatter
This is an open discussion with 49 replies, filed under Extensions.
Search
i’ve tried tables, definition lists, email obfuscation via automatic links, and id declarations with both markdown extra and extra w/ smartypants, to no avail.
excellent. i’ll grab that commit asap. thanks, nick!
when i use this in google chrome for linux, if i start an ordered list by inputting ‘1. test’ and hit enter, it becomes:
1. test 1. 2. List item1. 1.
this doesn’t seem to happen in firefox.
edit: the same behavior seems to appear with unordered lists
I get the same thing in the forum on Chrome. It’s… Weird.
Is this happening the textarea the instant you’re pressing return (i.e. a JavaScript formatting helper) or is the returned markup messed up?
I still can’t get my tables to work with Markdown Extra enabled :-( Can somebody please confirm that this actualy works?:
header 1 | header 2 -------- | -------- content | content
When I put above in a textarea with Markdown extra enabled, it just gets outputted as plain HTML: ‘header 1 | header 2 ———— | ———— content | content ‘.
Is it this bug?
kanduvisla: i followed nick’s instructions on fixing the markdown extra bug and tables are working for me.
phoque: it’s the javascript formatting helper.
@fawx: so the bug you’re reporting has to do with the helper, not the formatter itself. Wich one do you have installed?
That bugfix did the trick for me! Looks like this bug sneaky slipped in into 2.1.1. I have confidence however that this will get fixed in 2.2. Am I right guys? ;-)
@phoque: that’s a good call. i had completely forgotten i was using the wmd editor. i’ll move to that thread.
There is an issue when using Markdown with HTML5 block elements.
Who is in charge of this extension at the moment?
Would it be possible to replace this HTML purifier library with something more simple and effective (why has it been introduced?). This was once a small and focussed extension that has now a footprint of 1.5 MB.
Who is in charge of this extension at the moment?
Symphony team: https://github.com/symphonycms/markdown
Just because it's 1.5MB doesn't mean it's bad. Are you having specific problems with HTML Purifier?
Sorry for advertising my module, but try Templated Text Formatters - it will be good for you ;).
Seriously though, it uses libraries from this excellent extension, but allows you to improve formatter by chaining it with others (e.g., you can "format" text before Makrdown, and then again after Markdown, to fix any remaining problems).
We're using it in a project here, and i already added stuff like:
- automatic conversion of 23C to 3 (Celsius - forum removes special sign), Fahrenheit, Exponentiation;
- removing double spaces (and spaces before comma);
- setting a field which accepts CSV and turns it into HTML table;
- "natural" syntax for links and embedding images (and online videos);
- and more.
All that without even touching PHP (ok, there are two regex replacements that use /e switch to call PHP's floatvar() function), or editing any files :). You need to know at least basics of regular expressions tough.
Just because it's 1.5MB doesn't mean it's bad. Are you having specific problems with HTML Purifier?
Yes, it's bloating an extension which has just a simple task: apply Markdown formatting. In my opinion HTML Purifier should be a standalone extension (which for example could make use of a delegate to parse texts after they have been formatted with whatever text-formatter).
It never felt right that it was added to the Markdown formatter - it always felt like it was a quick and dirty fix for a problem that you don't have in most of the use cases of a Symphony text-formatter.
I agree with Nils. I have never understood why the Markdown extension has been "bloated". In my eyes it should only do what it advertises: Markdown.
My flippant, although pragmatic reply would be to live with it and ignore the "With HTML Purifier" option in the list, you don't need to use it if you don't want to (just as I never use SmartyPants, but it doesn't bother me that the library is bundled with the extension).
There is good reason for it to be included — user generated content. If you're accepting comments that are formatted as Markdown then you want an element of control over the elements that are rendered.
Create an account or sign in to comment.
Ah, yes, both files seem to create the same function (without checking if it already exists).
Looking at the code, I think this will not be an easy fix.