raptorjs-legacy / raptorjs

Source code for the RaptorJS Toolkit
Other
94 stars 12 forks source link

Not all XML entities are supported #40

Closed philidem closed 11 years ago

philidem commented 11 years ago

The SAX parser that raptor is using only supports these entities by default: & < > ' "

Other entities (such as &nbsp;) are not supported. Maybe configure the parser to not decode the entities and just let them pass through as text. Maybe you could also support something like <xml:entity value="nbsp" />.

See https://github.com/isaacs/sax-js#regarding-doctypes-and-entitys

patrick-steele-idem commented 11 years ago

There are two existing solutions:

  1. Use the following: ${entity:nbsp}
  2. Paste the unicode character directly into your template and don't use entities (for non-whitespace characters at least)

If support for new entities were added, the entities will have been decoded to unicode characters during XML parsing and unless the compiler re-encodes the special unicode characters using entities, the unicode character would be included as part of the output (encoded as UTF-8).