Skip to content

Commit a0f9d4b

Browse files
committed
Enable smart punctuation
1 parent bb587b1 commit a0f9d4b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/librustdoc/html/markdown.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ pub(crate) fn opts() -> Options {
5252
| Options::ENABLE_FOOTNOTES
5353
| Options::ENABLE_STRIKETHROUGH
5454
| Options::ENABLE_TASKLISTS
55+
| Options::ENABLE_SMART_PUNCTUATION
5556
}
5657

5758
/// A subset of [`opts()`] used for rendering summaries.
5859
pub(crate) fn summary_opts() -> Options {
59-
Options::ENABLE_STRIKETHROUGH
60+
Options::ENABLE_STRIKETHROUGH | Options::ENABLE_SMART_PUNCTUATION
6061
}
6162

6263
/// When `to_string` is called, this struct will emit the HTML corresponding to

src/test/rustdoc/inline_cross/add-docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ extern crate inner;
44

55

66
// @has add_docs/struct.MyStruct.html
7-
// @has add_docs/struct.MyStruct.html "Doc comment from 'pub use', Doc comment from definition"
7+
// @has add_docs/struct.MyStruct.html "Doc comment from pub use, Doc comment from definition"
88
/// Doc comment from 'pub use',
99
pub use inner::MyStruct;

src/test/rustdoc/smart-punct.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![crate_name = "foo"]
2+
3+
//! This is the "start" of the 'document'! How'd you know that "it's" the start?
4+
//!
5+
//! # Header with "smart punct'"
6+
//!
7+
//! [link with "smart punct'" -- yessiree!][]
8+
//!
9+
//! [link with "smart punct'" -- yessiree!]: https://www.rust-lang.org
10+
11+
// @has "foo/index.html" "//p" "This is the “start” of the ‘document’! How’d you know that “it’s” the start?"
12+
// @has "foo/index.html" "//h1" "Header with “smart punct’”"
13+
// @has "foo/index.html" '//a[@href="https://www.rust-lang.org"]' "link with “smart punct’” – yessiree!"

0 commit comments

Comments
 (0)