diff --git a/src/wattsi.pas b/src/wattsi.pas index 81c07a9..5d1c205 100644 --- a/src/wattsi.pas +++ b/src/wattsi.pas @@ -31,7 +31,7 @@ should have a popup of the
when hovered -use instead of +use instead of ****************************) @@ -60,6 +60,8 @@ kUndefinedAttribute = 'undefined'; kSplitFilenameAttribute = 'split-filename'; kSplitFilenameTargetAttribute = 'split-filename-target'; + kLTAttribute = 'lt'; + kHrefAttribute = 'href'; kNonNormative = 'This section is non-normative.'; kEllipsis = #$22F0; Months: array[1..12] of UTF8String = ('January', 'February', 'March', 'April', @@ -654,6 +656,8 @@ TCrossReferences = record else if (Element.IsIdentity(nsHTML, eDFN)) then begin + if (Element.HasAttribute(kLTAttribute)) then + Fail(' with lt="" found, use data-x="" instead; dfn is ' + Describe(Element)); CrossReferenceName := GetTopicIdentifier(Element); if (Assigned(InDFN)) then Fail('Nested : ' + Describe(Element)); @@ -691,17 +695,26 @@ TCrossReferences = record else if (Element.IsIdentity(nsHTML, eCode) and (not Assigned(InDFN))) then begin + if (Element.HasAttribute(kLTAttribute)) then + Fail(' with lt="" found, use data-x="" instead; code is ' + Describe(Element)); SaveCrossReference(Element); end else if (Element.IsIdentity(nsHTML, eSpan)) then begin + if (Element.HasAttribute(kLTAttribute)) then + Fail(' with lt="" found, use data-x="" instead; span is ' + Describe(Element)); if (Assigned(InDFN)) then Fail(' inside ; span is ' + Describe(Element)) else SaveCrossReference(Element); end else + if (Element.isIdentity(nsHTML, eA) and (not Element.HasAttribute(kHrefAttribute))) then + begin + Fail(' without href found: ' + Describe(Element)); + end + else if (Element.IsIdentity(nsHTML, eI) and (not Assigned(InDFN)) and (Element.HasAttribute(kCrossRefAttribute))) then begin if (Element.GetAttribute(kCrossRefAttribute).IsEmpty) then