Open ZeWaka opened 3 years ago
Note: This is not clearly specified in the documentation that it only works for Rust as well.
Here is the line of code that causes this behavior: https://github.com/rust-lang/mdBook/blob/c83bbd631930787c7844b185917d40bcc28733d8/src/renderer/html_handlebars/hbs_renderer.rs#L803-L805
Therefore, since the language is not Rust, we execute https://github.com/rust-lang/mdBook/blob/3f39ba82f9b9cdaa0e8dd3eed91decb1e31a7de4/src/renderer/html_handlebars/hbs_renderer.rs#L851-L853 instead, leading us to not call hide_lines.
hide_lines
This might just be an oversight. However, I know some languages would not be happy with this, as they use # for comments.
#
Therefore, a proper fix for this (imo) would be a configurable BORING_LINES_REGEX, and remove the language restriction.
BORING_LINES_REGEX
+1 Would also love to see this!
Note: This is not clearly specified in the documentation that it only works for Rust as well.
Here is the line of code that causes this behavior: https://github.com/rust-lang/mdBook/blob/c83bbd631930787c7844b185917d40bcc28733d8/src/renderer/html_handlebars/hbs_renderer.rs#L803-L805
Therefore, since the language is not Rust, we execute https://github.com/rust-lang/mdBook/blob/3f39ba82f9b9cdaa0e8dd3eed91decb1e31a7de4/src/renderer/html_handlebars/hbs_renderer.rs#L851-L853 instead, leading us to not call
hide_lines
.This might just be an oversight. However, I know some languages would not be happy with this, as they use
#
for comments.Therefore, a proper fix for this (imo) would be a configurable
BORING_LINES_REGEX
, and remove the language restriction.