Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Jun 12, 2018

Don't escape contents of PCDATA elements, like <style> and <script>.

Resolves issue #127.

Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One clarification needed.

* @return{string} The serialized element (like innerHTML)
*/
public serializeInner(adaptor: LiteAdaptor, node: LiteElement) {
const PCDATA = (this.constructor as typeof LiteParser).PCDATA;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand that. PCDATA is static on LiteParser, so can't you just get to that via LiteParser.PCDATA?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The liteAdaptor is pretty minimal, so it may well need to be subclassed. This allows the subclass's PCDATA to be used. Without this, you would have to override serializeInner() in the subclass just to change the explicit LiteParser reference.

Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@dpvc dpvc merged commit 670681b into master Aug 16, 2018
@dpvc dpvc deleted the issue127 branch August 16, 2018 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants