NSHipster / SwiftSyntaxHighlighter

A syntax highlighter for Swift code that uses SwiftSyntax to generate Pygments-compatible HTML.
https://nshipster.com/swiftsyntax/
MIT License
276 stars 12 forks source link

Remove HTMLEntities dependency #10

Closed mattt closed 4 years ago

mattt commented 4 years ago

While working on swift-doc, I noticed that the a significant chunk of the build time was stuck on this step:

[36/39] Compiling HTMLEntities Constants.swift

Searching around, I found this issue, which described the slow compile time of the large dictionary literal (SR-10209).

Our use of HTMLEntities here is overkill — we need to escape only a handful of characters, and certainly don't need them to have named entities. This PR removes the dependency in favor of a function I borrowed from @NSHipster/HypertextLiteral.