File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ const html = render(tree, options)
8989| ** [ ` closingSingleTag ` ] ( #closingSingleTag ) ** | ` {String} ` | [ ` > ` ] ( #default ) | Specify the single tag closing format|
9090| ** [ ` quoteAllAttributes ` ] ( #quoteAllAttributes ) ** | ` {Boolean} ` | [ ` true ` ] ( #default ) | Put double quotes around all tags, even when not necessary.|
9191| ** [ ` replaceQuote ` ] ( #replaceQuote ) ** | ` {Boolean} ` | [ ` true ` ] ( #default ) | Replaces quotes in attribute values with ` "e; ` .|
92+ | ** [ ` quoteStyle ` ] ( #quoteStyle ) ** | `{0| 1| 2}`| [ ` 2 ` ] ( #default ) | Specify the style of quote arround the attribute values|
9293
9394### ` singleTags `
9495
@@ -200,6 +201,33 @@ Replaces quotes in attribute values with `"e;`.
200201<img src =" <?php echo $foo[" bar " ] ?>" >
201202```
202203
204+ ### ` quoteStyle `
205+
206+ ##### ` 2 (Default) `
207+
208+ Attribute values are wrapped in double quotes:
209+
210+ ``` html
211+ <img src =" https://example.com/example.png" onload =" testFunc(" test " )" >
212+ ```
213+
214+ ##### ` 1 `
215+
216+ Attribute values are wrapped in single quote:
217+
218+ ``` html
219+ <img src =' https://example.com/example.png' onload =' testFunc("test")' >
220+ ```
221+
222+ ##### ` 0 `
223+
224+ Quote style is based on attribute values (an alternative for ` replaceQuote ` option):
225+
226+ ``` html
227+ <img src =" https://example.com/example.png" onload =' testFunc("test")' >
228+ ```
229+
230+
203231[ npm ] : https://img.shields.io/npm/v/posthtml-render.svg
204232[ npm-url ] : https://npmjs.com/package/posthtml-render
205233
You can’t perform that action at this time.
0 commit comments