Skip to content

Commit 3b11b2d

Browse files
committed
Fix the <ref> processing again
The string/rope semantics continue to bite us. The original fix in bd1cd44 was not correct, for unclear reasons. This version uses ExtractAll() to ensure we get a fresh CutRope that we can AppendDestructively() to Scratch, which is more in line with what other parts of the file do.
1 parent 0ad4342 commit 3b11b2d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/wattsi.pas

+8-2
Original file line numberDiff line numberDiff line change
@@ -1585,19 +1585,25 @@ TCrossReferences = record
15851585
ListNode^.Next := References[ReferenceName];
15861586
References[ReferenceName] := ListNode;
15871587
MissingReferences[ReferenceName] := ListNode;
1588+
15881589
NewLink := ConstructHTMLElement(eA);
15891590
Scratch := Default(Rope);
1591+
ExtractedData := Element.TextContent.ExtractAll();
15901592
Scratch.Append('#refs');
1591-
Scratch.Append(@ReferenceName);
1593+
Scratch.AppendDestructively(ExtractedData);
15921594
NewLink.SetAttributeDestructively('href', Scratch);
1595+
15931596
Scratch := Default(Rope);
1597+
ExtractedData := Element.TextContent.ExtractAll();
15941598
Scratch.Append('[');
1595-
Scratch.Append(@ReferenceName);
1599+
Scratch.AppendDestructively(ExtractedData);
15961600
Scratch.Append(']');
15971601
NewLink.AppendChild(TText.CreateDestructively(Scratch));
1602+
15981603
(Node.ParentNode as TElement).ReplaceChild(NewLink, Node);
15991604
Node.Free();
16001605
Node := NewLink;
1606+
16011607
Result := ProcessNode(Node);
16021608
end
16031609
else

0 commit comments

Comments
 (0)