-
Notifications
You must be signed in to change notification settings - Fork 536
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? |
links = doc('a[href="http://external.url"][rel="nofollow"]') | ||
assert links[0].text == 'http://example.com' | ||
assert doc('strong')[0].text == 'markup' | ||
|
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.
Can you add a test of mixed html and markdown, simulating someone editing an existing html string and adding markdown to it. We would expect the html to be stringified and the markdown to be formatted to html right?
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.
test_markdown
does have a case of mixed HTML and markdown, and yeah -- the HTML is stringified, the markdown is formatted.
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.