Skip to main content
added 101 characters in body
Source Link

Will lazy loading of syntaxes be supported?

This would allow for syntax highlighting of less common languages that don't need to be eager-loaded on every page load.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following examples:

lang-diff

```lang-diff

- print('failure')
+ print('success')

lang-elixir

```lang-elixir

spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)
  
receive do
  {:msg, contents} -> IO.puts(contents)
end

lang-bf

```lang-bf

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following examples:

lang-diff

- print('failure')
+ print('success')

lang-elixir

spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end

lang-bf

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Will lazy loading of syntaxes be supported?

This would allow for syntax highlighting of less common languages that don't need to be eager-loaded on every page load.

Here's a proof-of-concept that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following examples:

```lang-diff

- print('failure')
+ print('success')

```lang-elixir

spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)
  
receive do
  {:msg, contents} -> IO.puts(contents)
end

```lang-bf

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
added 34 characters in body
Source Link

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following examples:

lang-diff

- print('failure')
+ print('success')

lang-elixir

spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

lang-bf

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following:

- print('failure')
+ print('success')
spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following examples:

lang-diff

- print('failure')
+ print('success')

lang-elixir

spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end

lang-bf

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
added 26 characters in body
Source Link

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

ProofHighlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following:

- print('failure')
+ print('success')
spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Proof of concept

Naturally it's a little hacky, but it works on all of the following:

- print('failure')
+ print('success')
spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Here's a proof-of-concept for lazy loading of syntaxes that doubles as a Tampermonkey user-script:

Highlight.js lazy-loading proof of concept

Naturally it's a little hacky, but it works on all of the following:

- print('failure')
+ print('success')
spawn_link(fn ->
  send(current_process, {:msg, "hello world"})
end)

receive do
  {:msg, contents} -> IO.puts(contents)
end
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Source Link
Loading