Hi, this pull request changes two things. First function registerLanguages() will only register files that exist. This allows you to have as few files in the language folder as you need. Second function registerLanguage() has a new argument. This allows you to register custom files in the same way as the automatic registration, the default is to not overwrite language definition in the internal storage.
What problem does this solve? It should give you a bit flexibility and a performance improvement, in case you register custom files with registerLanguage(). For example a large API documentation on my computer (MacBook, PHP 7.1.16) took 200 ms to generate before, 120 ms after.
I am really impressed how fast this syntax highlighter works. The API documentation mentioned above previously took 850 ms to generate with another syntax highlighter. Great work. 👍
Hi, this pull request changes two things. First
function registerLanguages()
will only register files that exist. This allows you to have as few files in the language folder as you need. Secondfunction registerLanguage()
has a new argument. This allows you to register custom files in the same way as the automatic registration, the default is to not overwrite language definition in the internal storage.What problem does this solve? It should give you a bit flexibility and a performance improvement, in case you register custom files with
registerLanguage()
. For example a large API documentation on my computer (MacBook, PHP 7.1.16) took 200 ms to generate before, 120 ms after.I am really impressed how fast this syntax highlighter works. The API documentation mentioned above previously took 850 ms to generate with another syntax highlighter. Great work. 👍