rust/src/librustdoc/html
bors ab10778854 Auto merge of #80226 - ThePuzzlemaker:issue-80004-fix, r=jyn514,petrochenkov
Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers

Previously, edition-specific keywords (such as `async` and `await`) were not highlighted in code blocks, regardless of what edition was set. With this PR, this issue is fixed.

Now, the following behavior happens:
- When a code block is explicitly set to edition X, keywords from edition X are highlighted
- When a code block is explicitly set to a version that does not contain those keywords from edition X (e.g. edition Y), keywords from edition X are **not** highlighted
- When a code block has no explicit edition, keywords from the edition passed via `--edition` to rustdoc are highlighted

For example, a project set with `edition = "2015"` in its `Cargo.toml` would not highlight `async`/`await` unless the code block was set to `edition2018`. Additionally, a project set with `edition = "2018"` in its `Cargo.toml` *would* highlight `async`/`await` unless the code block was set to a version that did not contain those keywords (e.g. `edition2015`).

This PR fixes #80004.

r? `@jyn514`
2020-12-25 11:16:53 +00:00
..
highlight rustdoc: Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers 2020-12-24 12:46:17 -06:00
markdown impl Default for LangString, replacing all_false by default 2020-12-20 00:26:38 +01:00
render rustdoc: Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers 2020-12-24 12:46:17 -06:00
static Auto merge of #79742 - GuillaumeGomez:move-tooltips-messages-out-of-html, r=Nemo157 2020-12-24 15:22:28 +00:00
toc Format the world 2019-12-22 17:42:47 -05:00
escape.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
format.rs Remove DefPath from Visibility and calculate it on demand 2020-12-18 12:29:55 -05:00
highlight.rs rustdoc: Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers 2020-12-24 12:46:17 -06:00
layout.rs Fixes submit event of the search input 2020-12-13 00:25:06 +01:00
markdown.rs Auto merge of #80226 - ThePuzzlemaker:issue-80004-fix, r=jyn514,petrochenkov 2020-12-25 11:16:53 +00:00
mod.rs Make markdown module public for doc-tests 2020-11-15 11:21:13 -05:00
sources.rs rustdoc: Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers 2020-12-24 12:46:17 -06:00
static_files.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00
toc.rs Make all rustdoc functions and structs crate-private 2020-11-15 11:21:12 -05:00