-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output markdown instead of HTML #33
Comments
I also second this. WIth Markdown, the editor can easily be replaced with a <textarea> if Javascript is disabled. In addition, Markdown is easy to convert to other formats, so it can be converted on the fly to HTML if it's needed in some templates. |
shameless plug, since this was built for exactly this use: https://github.com/leeoniya/reMarked.js i did an example bi-directional editing demo using [the now-commerical-only] |
It won't be replaced with a <textarea>, that would render this whole lib useless ( |
reMarked.js does exactly this. |
Oh I see, cool stuff, will check it out when I investigate this! |
This is cool! Would be nice to have the same 2-way editing with a tiny editor.
It's probably better to reverse it - work natively with markdown, which is simpler, and then generate HTML as an additional sort of plugin. It should also be more reliable than reverse-engineering HTML. |
html -> markdown conversion sheds a significant amount of html/css features. so either you restrict the editor to only markdown-compatible features, silently drop htmlisms, or accept that you'll have a vast amount of html in your markdown output, which defeats the purpose [of clean output]. we've had several discussions on this topic previously: |
@jaredreich I think you don't understand. If JavaScript is not available, this all editor could be replaced by a single <textarea> containing all the Markdown text; the Markdown can then be easily edited by hand, unlike HTML. |
It is highly unlikely that in today's world JS is not available, and also that some app/site will work completely without JS... Trying to support this case for 0.00001% of users doesn't make any sense. |
@purplebonsai it would be quite odd for a WYSIWYG editor to fall back to Markdown. if anything, it would fall back to |
But |
It's 2017. JavaScript is always available. What isn't available is reliable internet connections on mobile devices, so if you want to optimise for something, optimise for that. |
No it's not. Not only you've decided to reply with unbearable arrogance and ignorance, but you're also making a fool of yourself showing a complete lack of understanding of how the Web works. There are countless reasons why JavaScript might not be available, for example ad-blockers, or for security reasons, accessibility issues, or you're required by your job requirements to support non-javascript environments (go tell your boss "It's 2017, I don't care what you say"), or browsers that block it by default (or maybe that don't support it), or maybe users just decided that they don't want to use JavaScript. You don't get to decide who uses JavaScript and who doesn't, the users do; grow up and get over this. If your way to work is "I don't care about anybody with JavaScript disabled", then this is a perfectly legitimate choice. But the responsibility for this choice is on you, do not shift it on the users. If a webpage doesn't work without JavaScript it's your fault, not the users' fault. Your insolence when tackling this issue is frankly embarrassing, but clearly a sign of high inexperience or maybe just incompetence. Besides, you've derailed this conversation out of topic completely. Whether this software should work with or without JavaScript is completely irrelevant for the discussion. If pell works only with JavaScript, so be it! We will all live with this; not a big problem. Neither I or anybody else for that matter, asked for pell to change this. If I want/need to make my website accessible to people who don't have JavaScript, I can either 1) choose another editor that works or 2) make myself a fallback when I can't use pell/javascript. Which brings us back to the original topic, "Output markdown instead of HTML": if the editor were to output Markdown instead of HTML, it would be easier to write a custom fallback because Markdown is significantly easier to deal with than HTML. |
If it's not available - 99.999% of all sites and apps will not work correctly anyway. Trying to base design decisions on the need to support this case is retarded. |
Discussing anything in here is completely pointless. There's none so deaf as those who will not hear. |
@purplebonsai if you're hell-bent on supporting users with js disabled, W3C's got your back [1]. just barf a textarea and tell 'em to enter whatever they want. there's no reason to have this edge case scenario live here. i suspect whatever project you end up contributing to isnt gonna tolerate you calling other contributors idiots. [1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript |
The other thing about it being 2017 is that I can no longer be bothered to argue with people like you. |
@purplebonsai thank you for contributing your time to posting your thoughts and feedback, but the whole reason this library exists is to be progressive and cut out the bloat that nearly all other editors have due to accounting for edge cases or browser incompatibilities that are either obsolete or heading towards obsolescence. Without that goal, this editor instantly becomes just like all the others. Sorry but I won't be writing or merging anything that accounts for javascript being disabled. Also, as a general rule in open source (or life, for that matter), you should refrain from blatant insulting and overall negativity. Just because people disagree with you doesn't mean they are inexperienced, arrogant, ignorant, a fool, insolent, etc. |
so having read through all the "comments" , can I get back to the original question ... can pell output markdown ? :) |
@jmls It cannot, but it does output HTML, which can be quickly and easily converted to markdown and back with another library such as https://github.com/domchristie/turndown |
I've added an markdown usage example to the README. |
UPDATE:
1ca5f79
https://github.com/jaredreich/pell#example-markdown
The text was updated successfully, but these errors were encountered: