Commit 6a9f5cb
authored
[Java.Interop.Tools.JavaSource] Improve
Parsing of `<a/>` elements would occasionally fail when they didn't
match our expectations/requirements:
* Unquoted URLs, a'la `android/database/sqlite/SQLiteDatabase.java`:
* <p> See <a href=https://www.sqlite.org/pragma.html#pragma_journal_mode>here</a> for more
Resulting in:
System.Xml.XmlException: 'https' is an unexpected token. The expected token is '"' or '''. Line 1, position 11.
or a'la `java/io/PipedOutputStream.java`
* @exception IOException if the pipe is <a href=#BROKEN> broken</a>,
resulting in:
System.Xml.XmlException: '#' is an unexpected token. The expected token is '"' or '''. Line 1, position 11.
* Improperly quoted attributes, a'la `android/telephony/PhoneNumberUtils.java`:
* Matching is based on <a href="https://github.com/google/libphonenumber>libphonenumber</a>.
Resulting in:
System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character. Line 1, position 67.
* Use of "raw" `&`, a'la `android/widget/ProgressBar.java`:
* <a href="https://material.io/guidelines/components/progress-activity.html#progress-activity-types-of-indicators">
* Progress & activity</a>.
Resulting in:
System.Xml.XmlException: An error occurred while parsing EntityName. Line 2, position 11.
Fix this by updating updating the `InlineHyperLinkOpenTerm` terminal
to *not* require `href`, and updating the `InlineHyperLinkDeclaration`
rule to better deal with whatever chaos is there.
When we encounter an `<a/>` element that points to code or a local
path we will now only include the element value in the javadoc, and
not the full `href` attribute value.
Replace the `IgnorableDeclaration` rule with an
`IgnorableCharTerminal` terminal. This better supports `@` in the
content stream when it's not part of a Javadoc inline tag, e.g.
`<a href="mailto:nobody@google.com">nobody</a>`.<a> parsing (#1126)1 parent d0231c5 commit 6a9f5cb
File tree
3 files changed
+94
-46
lines changed- src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource
- tests/Java.Interop.Tools.JavaSource-Tests
3 files changed
+94
-46
lines changedLines changed: 42 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
115 | 107 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
119 | 112 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | | - | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
| |||
184 | 178 | | |
185 | 179 | | |
186 | 180 | | |
187 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
188 | 197 | | |
189 | 198 | | |
190 | | - | |
| 199 | + | |
191 | 200 | | |
192 | 201 | | |
193 | | - | |
| 202 | + | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| |||
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
224 | | - | |
225 | 233 | | |
226 | 234 | | |
227 | | - | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
Lines changed: 31 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 112 | | |
122 | 113 | | |
123 | 114 | | |
| |||
156 | 147 | | |
157 | 148 | | |
158 | 149 | | |
159 | | - | |
160 | | - | |
161 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
162 | 158 | | |
163 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
164 | 184 | | |
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
| |||
0 commit comments