diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index c70ae8fb..b70db12e 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -1974,7 +1974,7 @@ def default_slugify(title: str) -> str: - https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/toc_filter.rb - https://gist.github.com/asabaylus/3071099 """ - return _SLUGIFY_CLEAN_REGEX.sub("", title.strip().lower().replace(" ", "-")) + return _SLUGIFY_CLEAN_REGEX.sub("", title.lower().replace(" ", "-")) def compute_unique_slug( diff --git a/tests/test_sphinx/sourcedirs/references/index.md b/tests/test_sphinx/sourcedirs/references/index.md index 74d0fd6a..5255b475 100644 --- a/tests/test_sphinx/sourcedirs/references/index.md +++ b/tests/test_sphinx/sourcedirs/references/index.md @@ -67,3 +67,7 @@ Known explicit [**hallo**](#paragraph-target) Known with title [](#title-target) Ambiguous [](#duplicate) + +# Image in title ![badge](https://shields.io/or/something.svg) + +[link up](#image-in-title-) diff --git a/tests/test_sphinx/test_sphinx_builds/test_references.html b/tests/test_sphinx/test_sphinx_builds/test_references.html index 55b13a77..35d1aed7 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_references.html +++ b/tests/test_sphinx/test_sphinx_builds/test_references.html @@ -263,6 +263,20 @@
+ + link up + +
+