Erel B4X founder Staff member Licensed User Longtime User May 7, 2020 #1 Example: https://www.b4x.com/js/ Prism is a popular JavaScript text highlighter: https://prismjs.com/index.html It is the same library that is installed in the forum and highlights the code. The B4X rules and a modified CSS file are attached. Note that it is not 100% perfect due to it being a context free parser, overall it does a good job and the code looks much better than plain text. Attachments prism.zip 9.1 KB · Views: 516 Last edited: Sep 30, 2021
Example: https://www.b4x.com/js/ Prism is a popular JavaScript text highlighter: https://prismjs.com/index.html It is the same library that is installed in the forum and highlights the code. The B4X rules and a modified CSS file are attached. Note that it is not 100% perfect due to it being a context free parser, overall it does a good job and the code looks much better than plain text.
ilan Expert Licensed User Longtime User May 7, 2020 #2 very good! like this we can show b4x code in a webview in our app.
LucaMs Expert Licensed User Longtime User May 7, 2020 #3 Haven't you "recently" posted such (similar) a thing?
ilan Expert Licensed User Longtime User May 7, 2020 #4 LucaMs said: Haven't you "recently" posted such (similar) a thing? Click to expand... no it wasnot me but i needed such a fuction. (relevant thread: https://www.b4x.com/android/forum/threads/custom-view-richviewfx-codearea.62823/page-2) but erels solution with html is much better and simpler to implement for my needs!
LucaMs said: Haven't you "recently" posted such (similar) a thing? Click to expand... no it wasnot me but i needed such a fuction. (relevant thread: https://www.b4x.com/android/forum/threads/custom-view-richviewfx-codearea.62823/page-2) but erels solution with html is much better and simpler to implement for my needs!
LucaMs Expert Licensed User Longtime User May 7, 2020 #5 I "remember" (very vaguely) something similar, also an Erel's thread (and that I tried to use it in Notepad++), but i can't find it again now. Last edited: May 7, 2020
I "remember" (very vaguely) something similar, also an Erel's thread (and that I tried to use it in Notepad++), but i can't find it again now.
Erel B4X founder Staff member Licensed User Longtime User May 7, 2020 #6 ilan said: very good! like this we can show b4x code in a webview in our app. Click to expand... Haven't thought about it but it should work. Another option: https://www.b4x.com/android/forum/t...e-parser-b4x-code-highlighter.109308/#content LucaMs said: Haven't you "recently" posted such (similar) a thing? Click to expand... True, but it required several additional steps to be actually used.
ilan said: very good! like this we can show b4x code in a webview in our app. Click to expand... Haven't thought about it but it should work. Another option: https://www.b4x.com/android/forum/t...e-parser-b4x-code-highlighter.109308/#content LucaMs said: Haven't you "recently" posted such (similar) a thing? Click to expand... True, but it required several additional steps to be actually used.