zulip/zerver/lib/markdown
Sumanth V Rao 033351609d markdown: Add data-codehilite-language attr for fenced code.
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.
2020-09-14 21:25:19 -07:00
..
__init__.py markdown: Replace hyperlink requirement with urllib.parse. 2020-09-13 15:37:28 -07:00
api_arguments_table_generator.py python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
api_return_values_table_generator.py python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
fenced_code.py markdown: Add data-codehilite-language attr for fenced code. 2020-09-14 21:25:19 -07:00
help_emoticon_translations_table.py
help_relative_links.py python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
help_settings_links.py python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
include.py
nested_code_blocks.py
tabbed_sections.py python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
testing_mocks.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
tlds-alpha-by-domain.txt