NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
This object is used to render a string of JavaScript code as a syntax-highlighted HTML block on a web page. It leverages the highlight.js library to achieve the syntax highlighting.
When the Process method is called, it automatically includes the necessary highlight.min.js and highlight/default.min.css files in the page's resources.
The Process method takes a single primary parameter:
# Assuming 'obj' is an instance of ObjProcessText
javascript_code = "function greet() { console.log('Hello, World!'); }"
html_output = obj.Process(script_content=javascript_code)
# The 'html_output' variable will now contain the HTML and JavaScript
# required to render the highlighted script on a web page.
The method returns an HTML string that contains a <pre><code class='javascript'> block with the provided script, along with a <script> tag to initialize the highlight.js library. If the input string is empty, it returns an empty string.