markdown-here
markdown-here copied to clipboard
Support for Asana.
Can you provide some details? What's broken? Screenshots? And so on.
Sure thing. Basically, if you type markdown in a task description and then toggle, it works as expected and even persists refreshes.
When you try and toggle it back to edit, it loses all formatting and markdown syntax.
Basically, Asana is this terrible piece of software that writes blog posts about how their entire company is run in markdown, and then they decide to not support it in their only product. Everyone learns Markdown; all content is in Markdown
There is a thread where people are highly coveting this markdown support and some people mention trying this very wonderful piece of open source software. Task descriptions & comments just got rich
If someone on the project could spec out how to make this work, I would be happy to make a PR with those fixes.
It looks like Asana's editor is incredibly aggressive about reformatting (or rewriting) its content. I took some screen captures to show it in action...
Here it is killing the MDH wrapper element (keep your eye on the right side):

And here it is killing a manually added title attribute as soon as the cursor moves:

I don't really have any good ideas for approaching this.
With some special case code the raw MD could be stored in the surrounding contenteditable element (and then even more special code to support select-render as well as full-content-render). But it will be lost as soon as the user switches to another task/comment (because the element is destroyed and recreated).
Alternatively, the raw MD could be stored in browser storage. But a) there would need to a visible identifier (number or whatever) stored in the rendered text to map back to the raw MD, and b) it would only work on that computer in that browser. (I'm ignoring crazier ideas like uploading the raw MD to the cloud.)
I'm willing to discuss other ideas, but I'm not going to be too happy if there are incredible changes necessary to support this one site.
Wow. I have tried to customize this site before manually with userscripts and userstyles and notices a lot of sloppy stuff in the inspector, but did not really make it to the editor.
Since their code isn't obfuscated, it might make sense to override the part that is causing this. But that does not sound feasible to expect of this extension. Unless it makes sense to have an experimental feature where you can toggle hacks for known sites, or put in your own.
Maybe just completely disable their rich text editor somehow, drop into normal textarea and then apply markdown-here?
hmmmh, I'm so frustrated with asana, I might take a stab at making this work.
Asana can't be supported. They communicate via websockets, and all data is constantly sent back and forth the moment you are ready with editing and everything is stripped. The way this plugin works is incompatible with the communications api asana has set up and their triggers and rendering ui framework.
I'm going to try to make a dedicated plugin for specifically asana.