mirror of https://github.com/zulip/zulip.git
033351609d
When converting fenced code markdown, we add the language (if specified) in a data-attribute by tweaking the HTML generated. Doing so, allows the frontend to make use of this attr to display view-in-playground option for codeblocks. We use pygments to get the lexer subclass name and use that instead of directly using the language in the data-attribute. Doing so, helps us map different language aliases (like `js` and `javascript`) into a common variable (like `JavaScript`) - and avoids the client from dealing with multiple tags corresponding to the same language. The html structure for a message like this: ``` js ..content.. ``` would now be: <div class="codehilite" data-codehilite-language="JavaScript"> <pre>..content..</pre> </div> Tests and fixtures amended. |
||
---|---|---|
.. | ||
apple | ||
import_fixtures | ||
ldap | ||
mattermost_fixtures | ||
saml | ||
slack_fixtures | ||
.gitignore | ||
authors.json | ||
config.generate_data.json | ||
csp_report.json | ||
docs_url_preview_data.json | ||
gitter_data.json | ||
markdown_test_cases.json | ||
narrow.json | ||
slack_message_conversion.json | ||
user_agents_unique |