Skip to content

Commit f735979

Browse files
Update option names in README for consistency
Renamed option headings and references to use 'set' prefix (e.g., 'setStrict', 'setWhitespaceTextNode') for consistency with method naming conventions. Improves clarity for users configuring parser options. https: //github.com/paquettg/pull/253 Co-Authored-By: Pete Medina <[email protected]>
1 parent 3be62da commit f735979

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -139,51 +139,51 @@ $dom->loadFromUrl('http://gmail.com'); // will not have whitespaceTextNode set t
139139

140140
At the moment we support 12 options.
141141

142-
**Strict**
142+
**setStrict**
143143

144-
Strict, by default false, will throw a `StrickException` if it find that the html is not strictly compliant (all tags must have a closing tag, no attribute with out a value, etc.).
144+
`setStrict`, by default `false`, will throw a `StrickException` if it find that the html is not strictly compliant (all tags must have a closing tag, no attribute with out a value, etc.).
145145

146-
**whitespaceTextNode**
146+
**setWhitespaceTextNode**
147147

148-
The whitespaceTextNode, by default true, option tells the parser to save textnodes even if the content of the node is empty (only whitespace). Setting it to false will ignore all whitespace only text node found in the document.
148+
The `setWhitespaceTextNode`, by default `true`, option tells the parser to save textnodes even if the content of the node is empty (only whitespace). Setting it to `false` will ignore all whitespace only text node found in the document.
149149

150-
**enforceEncoding**
150+
**setEnforceEncoding**
151151

152-
The enforceEncoding, by default null, option will enforce an character set to be used for reading the content and returning the content in that encoding. Setting it to null will trigger an attempt to figure out the encoding from within the content of the string given instead.
152+
The `setEnforceEncoding`, by default `null`, option will enforce an character set to be used for reading the content and returning the content in that encoding. Setting it to `null` will trigger an attempt to figure out the encoding from within the content of the string given instead.
153153

154-
**cleanupInput**
154+
**setCleanupInput**
155155

156-
Set this to `false` to skip the entire clean up phase of the parser. If this is set to true the next 3 options will be ignored. Defaults to `true`.
156+
Set `setCleanupInput` to `false` to skip the entire clean up phase of the parser. If this is set to true the next 3 options will be ignored. Defaults to `true`.
157157

158-
**removeScripts**
158+
**setRemoveScripts**
159159

160-
Set this to `false` to skip removing the script tags from the document body. This might have adverse effects. Defaults to `true`.
160+
Set `setRemoveScripts` to `false` to skip removing the script tags from the document body. This might have adverse effects. Defaults to `true`.
161161

162-
**removeStyles**
162+
**setRemoveStyles**
163163

164-
Set this to `false` to skip removing of style tags from the document body. This might have adverse effects. Defaults to `true`.
164+
Set `setRemoveStyles` to `false` to skip removing of style tags from the document body. This might have adverse effects. Defaults to `true`.
165165

166-
**preserveLineBreaks**
166+
**setPreserveLineBreaks**
167167

168-
Preserves Line Breaks if set to `true`. If set to `false` line breaks are cleaned up as part of the input clean up process. Defaults to `false`.
168+
`setPreserveLineBreaks` preserves line Breaks if set to `true`. If set to `false` line breaks are cleaned up as part of the input clean up process. Defaults to `false`.
169169

170-
**removeDoubleSpace**
170+
**setRemoveDoubleSpace**
171171

172-
Set this to `false` if you want to preserve whitespace inside of text nodes. It is set to `true` by default.
172+
Set `setRemoveDoubleSpace` to `false` if you want to preserve whitespace inside of text nodes. It is set to `true` by default.
173173

174-
**removeSmartyScripts**
174+
**setRemoveSmartyScripts**
175175

176-
Set this to `false` if you want to preserve smarty script found in the html content. It is set to `true` by default.
176+
Set `setRemoveSmartyScripts` to `false` if you want to preserve smarty script found in the html content. It is set to `true` by default.
177177

178-
**htmlSpecialCharsDecode**
178+
**setHtmlSpecialCharsDecode**
179179

180-
By default this is set to `false`. Setting this to `true` will apply the php function `htmlspecialchars_decode` too all attribute values and text nodes.
180+
By default `setHtmlSpecialCharsDecode` is set to `false`. Setting this to `true` will apply the php function `htmlspecialchars_decode` too all attribute values and text nodes.
181181

182-
**selfClosing**
182+
**setSelfClosing**
183183

184184
This option contains an array of all self closing tags. These tags must be self closing and the parser will force them to be so if you have strict turned on. You can update this list with any additional tags that can be used as a self closing tag when using strict. You can also remove tags from this array or clear it out completly.
185185

186-
**noSlash**
186+
**setNoSlash**
187187

188188
This option contains an array of all tags that can not be self closing. The list starts off as empty but you can add elements as you wish.
189189

0 commit comments

Comments
 (0)