Skip to content

Commit afe8802

Browse files
committed
Fix rendering anchor ref IDs in HTML (#565)
1 parent c9761a5 commit afe8802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flexmark-ext-attributes/src/main/java/com/vladsch/flexmark/ext/attributes/internal/AttributesAttributeProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public void setAttributes(@NotNull Node node, @NotNull AttributablePart part, @N
5858
attributes.addValue(CLASS_ATTR, attributeNode.getValue());
5959
} else if (attributeNode.isId()) {
6060
if (node instanceof AnchorRefTarget) {
61-
// was already provided via setAnchorRefId
61+
// was already provided via setAnchorRefId, we only have to read it
62+
attributes.remove(Attribute.ID_ATTR);
63+
attributes.addValue(Attribute.ID_ATTR, ((AnchorRefTarget) node).getAnchorRefId());
6264
} else {
6365
attributes.remove(Attribute.ID_ATTR);
6466
attributes.addValue(Attribute.ID_ATTR, attributeNode.getValue());

0 commit comments

Comments
 (0)