You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
The Source view uses webview with the view-source: prefix applied to the URL to get a formatted view of the Instant Articles markup.
This implementation gets the jobs done well, but it is preventing us from storing in the client the response from the preview webserver and forces us to to a loadURL. We should try to replace the BrowserWindow (webview) with an HTML view of the formatted code.
There ara multiple libraries that we could leverage, like Prism. I can think of a few approaches:
We show the unformatted code and the library used takes care of the formatting using JS and CSS.
We format the code from Node (for example, using prismjs and display the formatted text.
We use a pre-existing React component that displays formatted code (without using a webview).
The
Source
view uses webview with theview-source:
prefix applied to the URL to get a formatted view of the Instant Articles markup.This implementation gets the jobs done well, but it is preventing us from storing in the client the response from the preview webserver and forces us to to a
loadURL
. We should try to replace the BrowserWindow (webview) with an HTML view of the formatted code.There ara multiple libraries that we could leverage, like Prism. I can think of a few approaches:
I found this tutorial that describes something similar https://betterstack.dev/blog/code-highlighting-in-react-using-prismjs/
The text was updated successfully, but these errors were encountered: