Skip to content

Commit

Permalink
Use Rope.Append to set sha-link attribute
Browse files Browse the repository at this point in the history
This reverts 0751161 in favor of using Rope.Append in roughly the same
sort of way it’s used in similar cases in the source.
  • Loading branch information
sideshowbarker committed May 19, 2018
1 parent d77afcf commit 6d066f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/settings.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{$MACRO ON}
{$WRITEABLECONST OFF}
{$VARPROPSETTER OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS OFF}
Expand Down
8 changes: 5 additions & 3 deletions src/wattsi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ TCrossReferences = record

function ProcessNode(var Node: TNode): Boolean; // return True if we are to keep this node, False if we drop it
const
SourceGitSHALink: AnsiString = '';
SourceGitBaseURL: AnsiString = 'https://github.com/whatwg/html/commit/';
var
CandidateChild, SelectedForTransfer: TNode;
CurrentHeadingRank: THeadingRank;
Expand Down Expand Up @@ -951,8 +951,10 @@ TCrossReferences = record
begin
Element.AppendChild(TText.Create(SourceGitSHA));
Element.AppendChild(TText.Create(' commit'));
SourceGitSHALink := 'https://github.com/whatwg/html/commit/' + SourceGitSHA;
Element.SetAttribute('href', SourceGitSHALink);
Scratch := Default(Rope);
Scratch.Append(@SourceGitBaseURL);
Scratch.Append(@SourceGitSHA);
Element.SetAttributeDestructively('href', Scratch);
end
else
if (Element.isIdentity(nsHTML, eA) and (not Element.HasAttribute(kHrefAttribute))) then
Expand Down

0 comments on commit 6d066f9

Please sign in to comment.