File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ pub(crate) fn unique_id(id: &str, used: &mut HashSet<String>) -> String {
7474
7575/// Generates an HTML id from the given text.
7676pub ( crate ) fn id_from_content ( content : & str ) -> String {
77+ // This is intended to be close to how header ID generation is done in
78+ // other sites and tools, but is not 100% the same. Not all sites and
79+ // tools use the same algorithm. See these for more information:
80+ //
81+ // - https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links
82+ // - https://docs.gitlab.com/user/markdown/#heading-ids-and-links
83+ // - https://pandoc.org/MANUAL.html#extension-auto_identifiers
84+ // - https://kramdown.gettalong.org/converter/html#auto-ids
85+ // - https://docs.rs/comrak/latest/comrak/options/struct.Extension.html#structfield.header_ids
7786 content
7887 . trim ( )
7988 . to_lowercase ( )
You can’t perform that action at this time.
0 commit comments