File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
material/plugins/tags/structure/listing/manager
src/plugins/tags/structure/listing/manager Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ def replace(match: Match) -> str:
176
176
# is unique, so we use the page source file path and the position
177
177
# of the match within the page as an identifier.
178
178
id = f"{ page .file .src_uri } :{ match .start ()} -{ match .end ()} "
179
+
180
+ # Replace whitespaces in the identifier that we computed, or we
181
+ # can't just prefix it with "#" - see https://t.ly/U_hfp
182
+ id = id .replace (" " , "-" )
179
183
self .data .add (Listing (page , id , config ))
180
184
181
185
# Replace directive with hx headline if listings are enabled, or
Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ def replace(match: Match) -> str:
176
176
# is unique, so we use the page source file path and the position
177
177
# of the match within the page as an identifier.
178
178
id = f"{ page .file .src_uri } :{ match .start ()} -{ match .end ()} "
179
+
180
+ # Replace whitespaces in the identifier that we computed, or we
181
+ # can't just prefix it with "#" - see https://t.ly/U_hfp
182
+ id = id .replace (" " , "-" )
179
183
self .data .add (Listing (page , id , config ))
180
184
181
185
# Replace directive with hx headline if listings are enabled, or
You can’t perform that action at this time.
0 commit comments