-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax highlighting has very limited support #446
Comments
Retype uses PrismJS for syntax highlighting. It appears ERB is not well supported by Prism. I ran a test using their playground and there was basically no syntax highlighting, see: https://prismjs.com/test.html#language=ruby Depending on your code sample, switching to Interestingly, VS Code does not appear to syntax highlight With Retype, all PrismJS language modules are dynamically loaded as required. All Prism supported languages are supported by Retype. |
I don't agree, it works well, see at https://prismjs.com/test.html#language=erb: With the follwoing template: <html>
<head><title>Ruby Toys -- <%= @name %></title></head>
<body>
<h1><%= @name %> (<%= @code %>)</h1>
<p><%= @desc %></p>
<ul>
<% @features.each do |f| %>
<li><b><%= f %></b></li>
<% end %>
</ul>
<p>
<% if @cost < 10 %>
<b>Only <%= @cost %>!!!</b>
<% else %>
Call for a price, today!
<% end %>
</p>
</body>
</html>
No, ERB highlight both HTML and Ruby while Ruby highlight only Ruby.
Yeah, VSCode highlight a very limited amount of languages, that's why there are tons of
On Prism.js website I can highlight the chunk of code I wanted with ERB: While on Retype it doesn't highlight anything. The example is live here and you can check the source code here. |
In #445 you said
So that must be it, Retype fails to load the ERB module (and maybe others) even if a code block is using the required language. |
We'll have to investigate. Could be the theme does not support those tokens. In the next Retype release, all the libraries are getting updated to their latest releases as well, so that might help. |
We have updated the Prism lang libraries and themes, and We are testing with the following code sample:
We have some more work to do on the Prism themes, so we might be able to hammer out the remaining For now, I'm going to close this issue. The improved Hope this helps. |
Retype v3.0 has been released and includes this fix. |
The library use as syntax highlighter is not documented in retype (see #445) so I don't know what are supported languages but I can already say it seems the library used is quite poor, I doesn't know the very famous ERB templating language that is included in any major syntax highlighter :
Is that because all modules/languages are not loaded by default in Retype? Or because the library used has very limited languages support? If option 1 could you enable all modules, if option 2 is that possible to change of library?
The text was updated successfully, but these errors were encountered: