I need a front end code highlighter to work inside of umbraco's grid.
I tried the following:
Implemented Steamdev Snippet to my umbraco, added the following setting to my grid:
{
"label": "Display as code",
"description": "Choose which kind of code is used",
"key": "class",
"view": "radiobuttonlist",
"prevalues": [
"code_snippet_html",
"code_snippet_javascript",
"code_snippet_css",
"code_snippet_ruby"
]
}
And this script:
//Code Snippet: If code-Datatype is selected in grid and class "code_snippet_xx" is chosen: use code.snippet script
$('.code_snippet_html').find( "pre" ).addClass("htmlCode");
$("pre.htmlCode").snippet("html",{style:"navy"});
I would now go to my content node, choose the umbraco "code" editor, add my code inside it and choose the for example "codesnippethtml".
That all works fine but when I add code without closing tags like this rewrite rule I wrote:
Hi Chris,
I would verify this behaviour of this JS library in a static HTML file. As I believe this may be the library of the code highlighter transforming your code snippet as opposed to this being specific to Umbraco.
Try this in a static file and let me know how you get on.
CodeHighlighter on Website
Hey,
I need a front end code highlighter to work inside of umbraco's grid.
I tried the following: Implemented Steamdev Snippet to my umbraco, added the following setting to my grid:
And this script:
I would now go to my content node, choose the umbraco "code" editor, add my code inside it and choose the for example "codesnippethtml".
That all works fine but when I add code without closing tags like this rewrite rule I wrote:
All tags will get "auto-closed". Here is the rule above on my websites front end:
Is there some way to remove this behaviour?
Hi Chris,
I would verify this behaviour of this JS library in a static HTML file. As I believe this may be the library of the code highlighter transforming your code snippet as opposed to this being specific to Umbraco.
Try this in a static file and let me know how you get on.
Thanks,
Warren
is working on a reply...