Skip to content

Commit

Permalink
Allow html hyperlinks with href in errors.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
unhammer committed Sep 18, 2024
1 parent 5f3f029 commit d826cb9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/errors.dtd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (C) 2016-2019, Kevin Brubeck Unhammer <[email protected]> -->
<!-- Copyright (C) 2016-2024, Kevin Brubeck Unhammer <[email protected]> -->

<!-- This program is free software: you can redistribute it and/or modify -->
<!-- it under the terms of the GNU General Public License as published by -->
Expand Down Expand Up @@ -41,7 +41,7 @@

<!ELEMENT header (title | references)+>

<!ENTITY % Text "(#PCDATA | em)*">
<!ENTITY % Text "(#PCDATA | em | a)*">

<!ELEMENT title %Text;>
<!ATTLIST title
Expand Down Expand Up @@ -70,3 +70,8 @@
>

<!ELEMENT em (#PCDATA)>

<!ELEMENT a (#PCDATA)>
<!ATTLIST a
href CDATA #REQUIRED
>
7 changes: 5 additions & 2 deletions src/errors.rnc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS A GENERATED FILE, DO NOT EDIT!
# Copyright (C) 2016-2019, Kevin Brubeck Unhammer <[email protected]>
# Copyright (C) 2016-2024, Kevin Brubeck Unhammer <[email protected]>

# This program is free software: you can redistribute it and/or modify

Expand Down Expand Up @@ -48,7 +48,7 @@ attlist.error &=
header = element header { attlist.header, (title | references)+ }
attlist.header &= empty

Text = (text | em)*
Text = (text | em | a)*
title = element title { attlist.title, Text }
attlist.title &= attribute xml:lang { text }

Expand All @@ -73,4 +73,7 @@ attlist.description &= attribute xml:lang { text }
em = element em { attlist.em, text }
attlist.em &= empty

a = element a { attlist.a, text }
attlist.a &= attribute href { text }

start = errors
2 changes: 1 addition & 1 deletion test/suggest/errors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<title xml:lang="se">Čállinmeattáhus</title>
</header>
<body>
<description xml:lang="en">The word "$1" exists in the dictionary, but means something different in this context.</description>
<description xml:lang="en">The word "$1" exists in the dictionary, but means something <a href="https://divvun.no">different</a> in this context.</description>
<description xml:lang="se">"$1" maŋis galggašii leat blah</description>
</body>
</default>
Expand Down

0 comments on commit d826cb9

Please sign in to comment.