File: link.in.html

package info (click to toggle)
golang-github-johanneskaufmann-html-to-markdown 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,080 kB
  • sloc: makefile: 3
file content (285 lines) | stat: -rw-r--r-- 6,446 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!--------------------------------------
                Basics
--------------------------------------->

<!--no href attributes-->
<p><a>no href</a></p>
<p><a href="">no href</a></p>
<p><a href="" title="link title">no href</a></p>

<hr />

<!--no content-->
<p><a href="/no_content"></a></p>
<p><a href="/no_content"> </a></p>
<p><a href="/no_content">  </a></p>
<p><a href="/no_content">

</a></p>
<p><a href="/no_content"><br /></a></p>

<!--no content but fallback-->
<p><a href="/no_content" title="link title"></a></p>


<hr />


<p><a href="/page.html">relative link</a></p>
<p><a href="http://simple.org/">absolute link</a></p>
<p><a href="/page?b=1&a=2">query params</a></p>
<p><a href="#heading">fragment heading</a></p>
<p><a href="#">fragment</a></p>
<p>
  Wir freuen uns über eine
  <a href="mailto:hi@example.com?body=Hello
Johannes		">Mail</a>!
</p>



<!--link with broken href-->
<p><a href="/page

">broken link</a></p>
<p><a href="/page

.html">broken link</a></p>


<p><a href="  example.com  ">with whitespace around</a></p>

<p><a href="http://Open Demo">with space inside</a></p>



<!--------------------------------------
            Attributes
--------------------------------------->

<!--link with title-->
<p><a href="/" title="link title">content</a></p>
<p><a href="/" title="  link title  ">content</a></p>

<!--link with multiline title-->
<p><a href="/" title="
link

title
">content</a></p>
<p><a href="/" title="&quot;link title&quot;">content</a></p>
<p><a href="/" title="'link title'">content</a></p>
<p><a href="/" title='"link title"'>content</a></p>




<!--------------------------------------
            Escaping
--------------------------------------->
<!--list with link-->
<ul>
    <li><a href="/page.html">a(b)[c]</a></li>
    <p><a href="/page.html">a]</a></p>
</ul>

<!--TODO: list with paragraph-->

<!--link-->
<div>
    <p><a href="/page.html">a(b)[c]</a></p>
    <p><a href="/page.html">a]</a></p>
</div>

<!--paragraph-->
<div>
    <p>a(b)[c]</p>

	<p>[a]</p>
	<p>[a</p>
    <p>a]</p>
	
	<p>(a)</p>
	<p>(a</p>
	<p>a)</p>
</div>


<!--------------------------------------
            Adjacent
--------------------------------------->
<p><a href="/">A</a><a href="/">B</a></p>
<p><a href="/">A</a> <a href="/">B</a></p>

<p>before<a href="/">A</a>middle<a href="/">B</a>after</p>
<p>before <a href="/">A</a> middle <a href="/">B</a> after</p>
<p>before  <a href="/">A</a>  middle  <a href="/">B</a>  after</p>



<!--------------------------------------
        Content and Combinations
--------------------------------------->

<!--link with space-->
<p>before<a href="/"> content </a>after</p>
<p>before <a href="/"> content </a> after</p>
<p>before  <a href="/">  content  </a>  after</p>


<hr />


<!--link with inline styles-->
<p><a href="/"><strong>bold</strong> and <em>italic</em> text</a></p>
<p><strong>bold <a href="/">and <em>italic</em></a> text</strong></p>


<!--link with one br-->
<a href="/">A<br/>B</a>

<!--link with two br-->
<a href="/">A<br/><br/>B</a>

<!--link with three br-->
<a href="/">A<br/><br/><br/>B</a>


<!--link with multiple div-->
<a href="/">
	<div>A</div>
	<div>B</div>
	<div>C</div>
</a>


<!--multiline link with too many newlines-->
<a href="/">
	<p>Start Line</p>
    <br /><br /><br />
    <span> </span>
    <br /><br /><br />
    <p>End Line</p>
</a>

<!--newlines inside link-->
<a href="/">
	<br /><br /><br />
	<p>newlines around the link content</p>
    <br /><br /><br />
</a>

<!--multiline link inside a list item-->
<ul>
	<li>
		<a href="/">
			<p>first text</p>
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<br />
			<p>second text</p>
		</a>
	</li>
</ul>


<!--link with image-->
<p><a href="/page.html"><img src="/image.jpg"></a></p>

<!--multiline link-->
<div>
	<a href="/page.html">
		<p>first text</p>
		<img src="/image.jpg">
		<p>second text</p>
	</a>
</div>

<!--link with headings-->
<div>
	<a href="/page.html">
		<h4>Heading A</h4>
		<h3>Heading B</h3>
	</a>
</div>

<!--link with an svg-->
<div>
	<a aria-label="aria label" title="title" href="/">
		<svg height="24" viewBox="0 0 16 16" version="1.1" width="24" aria-hidden="true"><path fill-rule="evenodd" d="..."></path></svg>
	</a>
</div>


<!-- link and strong inside word -->
<p>before <strong><a href="/">a inside strong</a></strong> after</p>
<p>before<strong><a href="/">a inside strong</a></strong>after</p>

<p>before <a href="/"><strong>strong inside a</strong></a> after</p>
<p>before<a href="/"><strong>strong inside a</strong></a>after</p>


<div>
	<p>before  <strong><a href="/">middle</a></strong>  after</p>
	<p>before <strong><a href="/">middle</a></strong> after</p>
	<p>before<strong><a href="/">middle</a></strong>after</p>

	<p>before  <strong><a href="/">  middle  </a></strong>  after</p>
	<p>before <strong><a href="/">  middle  </a></strong> after</p>
	<p>before<strong><a href="/">  middle  </a></strong>after</p>

	<p>before<strong><span></span><a href="/">with empty span</a><span></span></strong>after</p>
	<p>before<strong><span>  </span><a href="/">with empty span</a><span>  </span></strong>after</p>
	<p>before<strong><span><span>  </span> </span><a href="/">with empty span</a><span><span>  </span> </span></strong>after</p>

	<hr />

	<p>before<strong><a href="/">a</a> b</strong>after</p>
	<p>before<strong><a href="/">a</a>b</strong>after</p>
	<p>before<strong><a href="/">a</a> b <a href="/">c</a></strong>after</p>
</div>

<hr />

<p>before<i><a href="/">a inside italic</a></i>after</p>
<p>before<a href="/"><i>italic inside a</i></a>after</p>

<p>before<b><a href="/">a inside b</a></b>after</p>
<p>before<a href="/"><b>b inside a</b></a>after</p>

<p>before<b><a href="/"><strong>already bold</strong></a></b>after</p>

<hr />

<p>before<b><span><a href="/">middle</a></span></b>after</p>
<p>before<b><i><a href="/">inside bold & italic</a></i></b>after</p>
<p>before<b><i><a href="/">inside bold & italic</a>a</i>b</b>after</p>
<p>before<b><span><a href="/">inside bold & italic</a></span></b>after</p>
<p>before<b>a<i>b<a href="/">c</a>d</i>e</b>after</p>

<hr />

<p>before<b><i>italic</i><a href="/">link</a><strong>strong</strong></b>after</p>


<!--------------------------------------
                Nesting
--------------------------------------->

<a href="/a">
	<table>
		<tr>
			<td>
				<p>before</p>
				<a href="/b">another link</a>
				<p>after</p>
			</td>
		</tr>
	</table>
</a>