Skip to content

Commit d826cb9

Browse files
committed
Allow html hyperlinks with href in errors.xml
1 parent 5f3f029 commit d826cb9

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/errors.dtd

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright (C) 2016-2019, Kevin Brubeck Unhammer <unhammer@fsfe.org> -->
1+
<!-- Copyright (C) 2016-2024, Kevin Brubeck Unhammer <unhammer@fsfe.org> -->
22

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

4242
<!ELEMENT header (title | references)+>
4343

44-
<!ENTITY % Text "(#PCDATA | em)*">
44+
<!ENTITY % Text "(#PCDATA | em | a)*">
4545

4646
<!ELEMENT title %Text;>
4747
<!ATTLIST title
@@ -70,3 +70,8 @@
7070
>
7171

7272
<!ELEMENT em (#PCDATA)>
73+
74+
<!ELEMENT a (#PCDATA)>
75+
<!ATTLIST a
76+
href CDATA #REQUIRED
77+
>

src/errors.rnc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# THIS IS A GENERATED FILE, DO NOT EDIT!
2-
# Copyright (C) 2016-2019, Kevin Brubeck Unhammer <unhammer@fsfe.org>
2+
# Copyright (C) 2016-2024, Kevin Brubeck Unhammer <unhammer@fsfe.org>
33

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

@@ -48,7 +48,7 @@ attlist.error &=
4848
header = element header { attlist.header, (title | references)+ }
4949
attlist.header &= empty
5050

51-
Text = (text | em)*
51+
Text = (text | em | a)*
5252
title = element title { attlist.title, Text }
5353
attlist.title &= attribute xml:lang { text }
5454

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

76+
a = element a { attlist.a, text }
77+
attlist.a &= attribute href { text }
78+
7679
start = errors

test/suggest/errors.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<title xml:lang="se">Čállinmeattáhus</title>
2929
</header>
3030
<body>
31-
<description xml:lang="en">The word "$1" exists in the dictionary, but means something different in this context.</description>
31+
<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>
3232
<description xml:lang="se">"$1" maŋis galggašii leat blah</description>
3333
</body>
3434
</default>

0 commit comments

Comments
 (0)