zulip/zerver/lib/bugdown
Steve Howell 46a49777c4 Add stream ids to urls for stream-related narrows.
This commit prefixes stream names in urls with stream ids,
so that the urls don't break when we rename streams.

strean name: foo bar.com%
before: #narrow/stream/foo.20bar.2Ecom.25
after: #narrow/stream/20-foo-bar.2Ecom.25

For new realms, everything is simple under the new scheme, since
we just parse out the stream id every time to figure out where
to narrow.

For old realms, any old URLs will still work under the new scheme,
assuming the stream hasn't been renamed (and of course old urls
wouldn't have survived stream renaming in the first place).  The one
exception is the hopefully rare case of a stream name starting with
something like "99-" and colliding with another stream whose id is 99.

The way that we enocde the stream name portion of the URL is kind
of unimportant now, since we really only look at the stream id, but
we still want a safe encoding of the name that is mostly human
readable, so we now convert spaces to dashes in the stream name.  Also,
we try to ensure more code on both sides (frontend and backend) calls
common functions to do the encoding.

Fixes #4713
2018-02-19 09:03:11 -08:00
..
__init__.py Add stream ids to urls for stream-related narrows. 2018-02-19 09:03:11 -08:00
api_arguments_table_generator.py api docs: Generate Arguments table from JSON. 2017-12-29 17:03:36 -05:00
api_code_examples.py bugdown/api_code_examples: Add support for multiple languages. 2018-02-16 10:07:13 -08:00
fenced_code.py zerver/lib: Remove u prefix from strings. 2018-02-05 12:12:58 -08:00
testing_mocks.py zerver/lib: Use python 3 syntax for typing. 2017-11-21 20:56:40 -08:00
tlds-alpha-by-domain.txt [manual] Rename Django app from zephyr to zerver. 2013-08-06 07:39:36 -04:00