File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ const filters: Filters = {
76
76
}
77
77
return `\`${ text } \``
78
78
} ,
79
+ P ( el ) {
80
+ const pElement = document . createElement ( 'p' )
81
+ const text = el . textContent || ''
82
+ pElement . textContent = text . replace ( / < ( \/ ? ) ( p r e | s t r o n g | w e a k | e m ) > / g, '\\<$1$2\\>' )
83
+ return pElement
84
+ } ,
79
85
STRONG ( el ) {
80
86
return `**${ el . textContent || '' } **`
81
87
} ,
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ describe('quote-selection', function () {
102
102
<p>This should not appear as part of the quote.</p>
103
103
<div class="comment-body">
104
104
<p>This is <strong>beautifully</strong> formatted <em>text</em> that even has some <code>inline code</code>.</p>
105
+ <p>This is a simple p line</p>
106
+ <p>some escaped html tags to ignore <pre> <strong> <weak> <em> </pre> </strong> </weak> </em></p>
105
107
<pre><code>foo(true)</code></pre>
106
108
<p><a href="http://example.com">Links</a> and <img alt=":emoji:" class="emoji" src="image.png"> are preserved.</p>
107
109
<blockquote><p>Music changes, and I'm gonna change right along with it.<br>--Aretha Franklin</p></blockquote>
@@ -131,6 +133,10 @@ describe('quote-selection', function () {
131
133
textarea . value . replace ( / + \n / g, '\n' ) ,
132
134
`> This is **beautifully** formatted _text_ that even has some \`inline code\`.
133
135
>
136
+ > This is a simple p line
137
+ >
138
+ > some escaped html tags to ignore \\<pre\\> \\<strong\\> \\<weak\\> \\<em\\> \\</pre\\> \\</strong\\> \\</weak\\> \\</em\\>
139
+ >
134
140
> \`\`\`
135
141
> foo(true)
136
142
> \`\`\`
You can’t perform that action at this time.
0 commit comments