]> git.lizzy.rs Git - rust.git/commit
rustdoc: make langstring parsing more robust
authorFlorian Gilcher <florian.gilcher@asquera.de>
Sat, 31 May 2014 22:33:32 +0000 (00:33 +0200)
committerFlorian Gilcher <florian.gilcher@asquera.de>
Sun, 1 Jun 2014 22:16:48 +0000 (00:16 +0200)
commit3fef7a74ca9a642f51cdf8ec4f148916580b34ce
tree4bf285d2deb05d0cf8dcc85672a9b4bd24920cc6
parent1527dab9980bf1f94419dcb8482ff1f0228a6f4b
rustdoc: make langstring parsing more robust

This changes the parsing of the language string
in code examples so that unrecognized examples
are not considered Rust code. This was, for example,
the case when a code example was marked `sh` for shell
code.

This relieves authors of having to mark those samples
as `notrust`.

Also adds recognition of the positive marker `rust`.

By default, unmarked examples are still considered rust.

If any rust-specific tags are seen, code is considered
rust unless marked as "notrust".

Adds test cases for the detection logic.
src/librustdoc/html/markdown.rs