robb / Swim

A DSL for writing HTML in Swift
312 stars 9 forks source link

Added raw nodes and escaped text nodes. #22

Closed chriseidhof closed 3 years ago

chriseidhof commented 3 years ago

This PR adds support for raw nodes (they get rendered as-is, without escaping their contents). This PR also changes the behaviour of text nodes, they now get escaped. I added some very basic tests for this.

The string escaping is taken from here: https://github.com/robb/robb.swift/blob/main/Sources/robb.swift/Extensions/String+XML.swift