Commit Graph

32 Commits

Author SHA1 Message Date
hollywoodno 401fae30f1 markdown: Render backend second level markdown.
By default, Python markdown tab length for indents is 4 spaces, which
require using 4 spaces or a tab to create nested elements. This
modifies that setting to specify 2-space indentation for nesting
elements only.

Modified significantly by tabbott to limit the change to just list
indentation.

Fixes #4252.
2017-04-07 16:14:57 -07:00
hollywoodno d6716838ad bugdown: Remove trailing whitespace on fence code blocks.
This fixes fenced code blocks that are copy-pasted from certain
clients having trailing whitespace anoyingly often.

Fixes #3998.
2017-03-22 14:17:34 -07:00
Yago González 34a9e1ae11 markdown: Add TeX typesetting support.
Co-authored-by: Reid Barton <rwbarton@gmail.com>

Fixes #2056.
2017-03-21 16:40:00 -07:00
Tim Abbott 74a3c4a13f bugdown: Add a Zulip emoji test. 2017-02-26 18:30:16 -08:00
Harshit Bansal 40d137d621 bugdown: Change rendered emoji image to `unicode/<codepoint>.png.`
Use `name_to_codepoint.json` file (and the similar structure in
emoji_codes.js) to map emoji names directly to codepoints and change
the rendered emoji image to `unicode/<codepoint.png>` rather than
`<emoji_name>.png`.

Fixes: #3539.
2017-02-26 18:30:15 -08:00
Rishi Gupta a2890f7d7a emoji: Remove duplicates from autocomplete and emoji picker.
Previously, if you searched for ':offi..' you would see both 🏢 and
:office_building: as possible completions, both of which are shortcodes for
the same unicode codepoint (and hence which have the same image). Also, we
sort the emoji in our emoji pickers alphabetically by shortcode, and so the
images for 🏢 and :office_building: show up next to each other, which
looks like a bug. This removes :office_building: as a shortcode, along with
several hundred other duplicates. It leaves some duplicates in that won't
give autocomplete or alphabetical ordering a problem, like (🚗,
:automobile:).
2017-01-28 23:38:03 -08:00
Tim Abbott b36e94c954 bugdown: Blacklist linkifying the .md TLD.
Fixes #2065.
2016-12-29 18:17:50 -08:00
Tim Abbott 39f0ffdedd Move static/third/gemoji to static/generated/emoji.
Fixes #1153.
2016-12-27 20:16:23 -08:00
hackerkid 67120d7a9d Support backend unicode-emoji rendering without whitespace. 2016-11-14 21:02:18 -08:00
hackerkid b2e91eae13 Add marked.js support to emojis in miscellaneous and dingbats block.
https://en.wikipedia.org/wiki/Emoji#Unicode_blocks
2016-11-14 15:58:16 -08:00
hackerkid 8c83b34ad5 Support backend emoji rendering without whitespace. 2016-11-11 16:18:57 -08:00
Igor Tokarev 852bc6b491 bugdown: Re-enable support for italics in bugdown.
Fixes: #1103.
2016-11-10 19:14:40 -08:00
Meena Rajan 30acb23314 bugdown: Add support for strikethrough in markdown processor.
[Tweaked to move tests to bugdown_data.json, add additional tests, and
add frontend processor support by tabbott]
2016-11-07 22:26:38 -08:00
umkay 5fe6e7c07c bugdown: Add tests for escaping raw html.
Adds additional tests in bugdown-data.json to check that we escape raw
html properly with script tags.

Many of these tests are based on the bleach "advanced" test suite.
2016-10-25 15:21:46 -07:00
hackerkid bca1953aa4 Add support for !gravatar syntax in echo.js. 2016-10-20 14:40:45 -07:00
hackerkid 95b5ac1d5d Add support for !avatar syntax in echo.js. 2016-10-20 14:40:33 -07:00
Tim Abbott 31b245eaea bugdown: Add tests for avatar/gravatar syntax. 2016-10-20 11:18:41 -07:00
umkay 82d03d603a Update Pygments to latest upstream version.
In HTML, the line break immediately following a start tag is ignored
(see: https://www.w3.org/TR/html4/appendix/notes.html#h-B.3.1). An
extra span tag has been introduced in the upstream Pygments
HtmlFormatter in order to preserve the first new line. The Bugdown
Tests as well as our fenced_code.js frontend markdown processor have
been updated to reflect this new behavior.
2016-09-12 21:58:25 -07:00
Tim Abbott e7aac717e8 Fix markdown ordering bugs with some custom syntax.
!avatar, !modal_link, !gravatar, etc. were incorrectly being processed
before the escape character for code blocks.

While we're at it, we add tests for these special syntaxes.
2016-08-18 14:47:37 -07:00
Alex Wilson b040839c76 Add unicode emoji to frontend markdown parser.
Fixes 2nd half of #1011.
2016-06-30 15:48:02 -07:00
Umair Khan c8d139b2b1 Fix emoji urls interaction with i18n.
When accessing emojis with relative urls we should start the urls with
a slash so that language code doesn't become part of these urls.

Fixes #1014.
2016-06-13 09:10:11 -07:00
Luke Faraone 8ea139c772 Fix bugdown fixture for dummy camo key
(imported from commit 698b261918457117a01ce51f69d49f54f35b3297)
2015-08-16 16:45:15 -07:00
Paul Ruan 12cb8ceae0 Time out when waiting for OpenGraph links that take too long.
One common place that this happens (for us) is on a local
Dropbox .dev.corp.dropbox.com instance, which can't be reached
by the Zulip servers.

This commit also:
* Fixes the test suite
* Properly previews /photos/ links

(imported from commit b4788b6236e7a9d390e1efc4673be34d9ba5e091)
2014-07-29 21:46:35 -07:00
Steve Howell 8f37c3f5fd Tolerate spaces after language in markdown fences.
See #2357.  We now support `~~~ .py ` with that trailing space.

Note that the test coverage is Python-side only due to
bugdown_matches_marked being set to false, since we don't yet
support language syntax on the client side.

(imported from commit ccd5fcb0eee01478d349161400103480678d7486)
2014-03-06 10:15:20 -05:00
Leo Franchi 05d911b913 Allow auto-linked URLs to end with a !, without including the ! in the url
(imported from commit 26fbf8d8318dc32f31f94f366750521afab94ac5)
2014-03-05 15:22:05 -05:00
Leo Franchi 8ad2ca15cd bugdown: Match up to 8 groups of nested parens
(imported from commit e3d61ec644fdb293322cab0a4449d8e1a27a513a)
2014-02-06 17:26:01 -05:00
Leo Franchi c218fc98b1 Add one more bugdown test
(imported from commit 43b2ef02c05faf73e4607f76cd00c67e9ba38b8d)
2014-02-05 12:02:27 -05:00
Leo Franchi bb21400732 [localecho] Properly escape HTML in code blocks
(imported from commit 11f7e4f440cdd3a2ef6debb10c3d5a07f4fd1a1a)
2014-02-03 12:57:54 -05:00
Leo Franchi ffb816391c Use our own fenced code preprocessor, fixing output mismatches
(imported from commit 3d4abb1043349e30adf265342ee7c946a99b3ce2)
2014-01-28 15:35:32 -05:00
Leo Franchi 5441409044 Consolidate emoji tests and test on frontend as well
(imported from commit 3244a93209b56b655b80633713a3f58ae46d06ff)
2014-01-27 12:07:48 -05:00
Leo Franchi 1c9a59fd3f Add newlines outside code blocks in marked.js to match bugdown
(imported from commit 7618260dbfa11209b3cc45d007407476897c2a20)
2014-01-23 16:50:29 -05:00
Leo Franchi aee127cdbe Share bugdown test data across frontend and backend tests
(imported from commit b278a60b5899cd336840e71d8e632e2b31338d82)
2014-01-23 16:50:29 -05:00