@@ -20,9 +20,14 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
2020<h1 >Headings</h1 >
2121<h1 >Heading 1</h1 >
2222<h2 >Heading 2</h2 >
23- <p >Heading 3</h3 >
24- <p >Heading 4</h4 >
23+ <p >Heading 3</p >
24+ <p >Heading 4</p >
25+ <p >Heading 5</p >
26+ <p >Heading 6</p >
27+ <p >####### Heading 7</p >
28+ <p >## Indented Heading</p >
2529<h1 >Heading no space</h1 >
30+ <h1 >Hashes at the end of the line get trimmed</h1 >
2631<h2 >Heading directly above a paragraph</h2 >
2732<p >Aenean congue venenatis rutrum. Suspendisse vehicula finibus volutpat. Nunc lacinia rhoncus nibh.</p >
2833<h1 >Bold and italics</h1 >
@@ -86,6 +91,8 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
8691<hr >
8792<p >Horizontal line using 3 underscores</p >
8893<hr >
94+ <p >Horizontal line with less than 3 doesn't render</p >
95+ <p >__</p >
8996"
9097`;
9198
@@ -96,8 +103,8 @@ exports[`renderNHSAppMarkdown should render markdown matching NHSApp email rules
96103Line 2
97104Line 3</p >
98105<p >With 2 trailing spaces:</p >
99- <p >Line 4
100- Line 5
106+ <p >Line 4< br >
107+ Line 5< br >
101108Line 6</p >
102109<h1 >Paragraphs</h1 >
103110<p >Paragraph 1</p >
@@ -111,7 +118,12 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
111118<h2 >Heading 2</h2 >
112119<h3 >Heading 3</h3 >
113120<h4 >Heading 4</h4 >
121+ <h5 >Heading 5</h5 >
122+ <h6 >Heading 6</h6 >
123+ <p >####### Heading 7</p >
124+ <p >## Indented Heading</p >
114125<p >#Heading no space</p >
126+ <h1 >Hashes at the end of the line get trimmed</h1 >
115127<h2 >Heading directly above a paragraph</h2 >
116128<p >Aenean congue venenatis rutrum. Suspendisse vehicula finibus volutpat. Nunc lacinia rhoncus nibh.</p >
117129<h1 >Bold and italics</h1 >
@@ -161,7 +173,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
161173<h1 >Image</h1 >
162174<p ><img src = " https://assets.nhs.uk/images/nhs-logo.png" alt = " NHS Logo" ></p >
163175<h1 >Links</h1 >
164- <p ><a href = " https://en.wikipedia.org/wiki/Markdown" >Link text</a ></p >
176+ <p ><a href = " https://en.wikipedia.org/wiki/Markdown" target = " _blank " rel = " noopener noreferrer " >Link text</a ></p >
165177<p >www.nhs.uk</p >
166178<p >nhs.uk</p >
167179<p >https://www.nhs.uk</p >
@@ -185,23 +197,25 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
185197</ul >
186198<p >Horizontal line using 3 underscores</p >
187199<hr >
200+ <p >Horizontal line with less than 3 doesn't render</p >
201+ <p >__</p >
188202"
189203`;
190204
191205exports[`renderSMSMarkdown should render markdown matching GOVUK Notify SMS rules 1`] = `
192206"<p ># Linebreaks</p >
193207<p >Without 2 trailing spaces:</p >
194- <p >Line 1
195- Line 2
208+ <p >Line 1< br >
209+ Line 2< br >
196210Line 3</p >
197211<p >With 2 trailing spaces:</p >
198- <p >Line 4
199- Line 5
212+ <p >Line 4< br >
213+ Line 5< br >
200214Line 6</p >
201215<p ># Paragraphs</p >
202216<p >Paragraph 1</p >
203217<p >Paragraph 2</p >
204- <p >Paragraph 3
218+ <p >Paragraph 3< br >
205219Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam vitae finibus.</p >
206220<p >Paragraph above two blank lines</p >
207221<p >Paragraph below two blank lines</p >
@@ -210,8 +224,13 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor vel quam
210224<p >## Heading 2</p >
211225<p >### Heading 3</p >
212226<p >#### Heading 4</p >
227+ <p >##### Heading 5</p >
228+ <p >###### Heading 6</p >
229+ <p >####### Heading 7</p >
230+ <p >## Indented Heading</p >
213231<p >#Heading no space</p >
214- <p >## Heading directly above a paragraph
232+ <p ># Hashes at the end of the line get trimmed ###</p >
233+ <p >## Heading directly above a paragraph<br >
215234Aenean congue venenatis rutrum. Suspendisse vehicula finibus volutpat. Nunc lacinia rhoncus nibh.</p >
216235<p ># Bold and italics</p >
217236<p >**Some bold text using asterisks**</p >
@@ -220,41 +239,43 @@ Aenean congue venenatis rutrum. Suspendisse vehicula finibus volutpat. Nunc laci
220239<p >_Some italic text using underscores_</p >
221240<p ># Lists</p >
222241<p >Bullets with asterisks:</p >
223- <p >* Duis finibus tellus augue, ut dapibus orci vehicula id.
224- * Proin in condimentum tellus, ac elementum ligula.
242+ <p >* Duis finibus tellus augue, ut dapibus orci vehicula id.< br >
243+ * Proin in condimentum tellus, ac elementum ligula.< br >
225244* Nulla libero nisl, hendrerit vel est quis, efficitur dignissim est.</p >
226245<p >Bullets with dashes:</p >
227- <p >- Duis finibus tellus augue, ut dapibus orci vehicula id.
228- - Proin in condimentum tellus, ac elementum ligula.
246+ <p >- Duis finibus tellus augue, ut dapibus orci vehicula id.< br >
247+ - Proin in condimentum tellus, ac elementum ligula.< br >
229248- Nulla libero nisl, hendrerit vel est quis, efficitur dignissim est.</p >
230249<p >Bullets without required spaces:</p >
231- <p >*bullet 1 no space
232- *bullet 2 no space
250+ <p >*bullet 1 no space< br >
251+ *bullet 2 no space< br >
233252*bullet 3 no space</p >
234253<p >Ordered list:</p >
235- <p >1. Praesent rutrum ex vel velit aliquam.
236- 2. Et viverra turpis vestibulum.
254+ <p >1. Praesent rutrum ex vel velit aliquam.< br >
255+ 2. Et viverra turpis vestibulum.< br >
2372563. Pellentesque quis nisi accumsan.</p >
238257<p >Ordered list without required spaces:</p >
239- <p >1.Step 1 no space
240- 2.Step 2 no space
258+ <p >1.Step 1 no space< br >
259+ 2.Step 2 no space< br >
2412603.Step 3 no space</p >
242261<p ># Image</p >
243- <p ></p >
262+ <p ></p >
244263<p ># Links</p >
245- <p >[Link text](<a href = " https://en.wikipedia.org/wiki/Markdown" >https://en.wikipedia.org/wiki/Markdown</a >)</p >
246- <p ><a href = " http://www.nhs.uk" >www.nhs.uk</a ></p >
247- <p ><a href = " http://nhs.uk" >nhs.uk</a ></p >
248- <p ><a href = " https://www.nhs.uk" >https://www.nhs.uk</a ></p >
249- <p ><a href = " http://nhs.uk" >http://nhs.uk</a ></p >
264+ <p >[Link text](<a href = " https://en.wikipedia.org/wiki/Markdown" target = " _blank " rel = " noopener noreferrer " >https://en.wikipedia.org/wiki/Markdown</a >)</p >
265+ <p ><a href = " http://www.nhs.uk" target = " _blank " rel = " noopener noreferrer " >www.nhs.uk</a ></p >
266+ <p ><a href = " http://nhs.uk" target = " _blank " rel = " noopener noreferrer " >nhs.uk</a ></p >
267+ <p ><a href = " https://www.nhs.uk" target = " _blank " rel = " noopener noreferrer " >https://www.nhs.uk</a ></p >
268+ <p ><a href = " http://nhs.uk" target = " _blank " rel = " noopener noreferrer " >http://nhs.uk</a ></p >
250269<p >user@domain.com</p >
251270<p >Links with < > symbols:</p >
252- <p >< <a href = " http://www.google.com" >www.google.com</a >> </p >
271+ <p >< <a href = " http://www.google.com" target = " _blank " rel = " noopener noreferrer " >www.google.com</a >> </p >
253272<p >< user@domain.com> </p >
254273<p ># Lines</p >
255274<p >Horizontal line using 3 asterisks</p >
256275<p >***</p >
257276<p >Horizontal line using 3 underscores</p >
258277<p >___</p >
278+ <p >Horizontal line with less than 3 doesn't render</p >
279+ <p >__</p >
259280"
260281`;
0 commit comments