Opened 13 years ago
Closed 13 years ago
#9971 closed Bug (invalid)
Filter's elementsName and attributesName string patterns are used as regexp
| Reported by: | Piotrek Koszuliński | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Core : Parser | Version: | |
| Keywords: | Cc: |
Description
var filter = new CKEDITOR.htmlParser.filter();
filter.addRules( {
elementNames: [
[ 'u', 'b' ],
[ 's', '' ]
]
} );
var writer = new CKEDITOR.htmlParser.basicWriter(),
fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<p><sup>A</sup><u>B</u></p>' );
fragment.writeHtml( writer, filter );
console.log( writer.getHtml() ); // <p><bp>A</bp><b>B</b></p>
When the expected output is:
<p><sup>A</sup><b>B</b></p>
The same happens for attributesName. IMO this is unexpected behaviour, because string is used as regexp when a true regexp can be passed too.
Change History (2)
comment:1 Changed 13 years ago by
| Summary: | Filter's elementsName and attributesName string pattern are used as regexp → Filter's elementsName and attributesName string patterns are used as regexp |
|---|
comment:2 Changed 13 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |

It may be confusing but it is fast, cause we don't have to check if that's string or regexp. This problem should be solved by better documentation.