-
Notifications
You must be signed in to change notification settings - Fork 535
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
Support Markdown in Add-on Listing Fields #22956
base: master
Are you sure you want to change the base?
Conversation
There should probably be a more informative way to explain what syntax or Markdown is supported, possibly similar to how GitHub explains it via the 'Markdown is Supported' button by navigating to a dedicated page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising. A few comments before testing.
Please add testing steps and I can verify the PR. |
@chrstinalin what should I expect to happen if I enter invalid or disallowed markdown syntax? Can you add that to the test scenario. Additionally can you clarify what "functional" means? I think you mean the syntax should be "rendered" on the page right? |
@chrstinalin I cannot find the developer comments section.. can you help navigating there? |
@chrstinalin something that would be very helpful when verifying this is if you could share a sample of both html and markdown that include a sample of all the supported tags. I even wonder if having this available to developers on a page could be useful. There are many flavors of markdown and looking at the tag, it's hard for me (with context) to know what and how I should input the syntax to get the expected result. Imagine how difficult it would be for a developer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs some work. A few bugs discovered and some edge cases needing addressing.
Also found a UX hangup that might be worth addressing in terms of usability of this feature.
Currently, if you were to put just a link in, it'd render similarly. If we're essentially treating user HTML as plaintext from now on, I can't see why this wouldn't be expected?
I had omitted it originally since it wasn't part of the original issue. Now that I think about it, though, there's probably no reason to do that.
At the very bottom of 'Edit Product Page', under 'Technical Details'.
As it did with HTML before, too. It did bother me, though. It shouldn't hurt to just add the rendering
Yeah, which is why I mentioned it before. Though I imagined something like:
Being a smoother way about it? |
Thanks for the updates. Everything checks out except this part:
If I render this on a browser:
I do not expect a clickable link to appear on the screen. I expect (just like github is doing, to just render out all the markup as plain text. I kind of have the same expectations for our "plain text" html where we render links. As you can see the html syntax is rendered as plain text, but somehow, the link is a clickable link.. that seems odd. Is that actually expected behaviour? why plaint text the links then? |
@KevinMind I see what you mean now -- I do agree its a bit weird. But I'd still say its expected here just as a result of the linkify bleach converting any string that looks like a URL, and the additional behaviour it provides still being necessary. I'm also a bit hesitant to the idea of doing a hack around this, since bleach is deprecated and there's a separate issue to replace it completely... I don't have any strong opinions on that, though, and I can still see arguments against that. I also asked Andrew about it, who agrees that it's not a problem (plaintext URLs should be linkified, and its hard to differentiate those from HTML ones. If anything, to make fixing it a follow-up). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes: mozilla/addons#15145
Description
Replaces HTML syntax support with Markdown support in the
description
,developer_comments
,eula
, andprivacy_policy
fields ofAddon
. Existing HTML in those fields will remain functional until the field is edited. No new HTML will be functional.Only the markdown-equivalent of currently allowed HTML attributes are allowed.
abbr
uses the PHP Markdown Extra syntax.DevHub:
Frontend:
Testing
New Add-ons
Existing Add-ons
* Any user-inputted HTML saved at this point is rendered as plaintext. Any allowed markdown in the field is rendered as expected in the frontend. Disallowed markdown is stripped from the result and not visible at all (this is to avoid showing the user the markdown formatted into HTML).
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.