Posted 8 years ago by Radjesh Klauke - Mr., X-impress
Avatar
Ola,

I'm loading an html-file which works fine, but how do I add the "outlining"?
With SyntaxEditor1
   .Text = read_text
   .Document.LoadLanguageFromXml(Application.StartupPath & "\lexer\html.xml", 0)
End With
Here's a small test_app, in which the code above is located: http://www.mediafire.com/?dmhsqiki71bjkx0

[Modified at 03/30/2011 07:53 AM]

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hydra,

In general, automatic outlining can be added in a code-behind class for dynamic language. If you are using a dynamic language you'd have to make a code-behind class that inherits DynamicOutliningSyntaxLanguage and would have to override GetTokenOutliningAction. Our sample JScriptDynamicSyntaxLanguage class shows this.

However for the HTML language, that is not easily done using this method since that requires start/end tag name matching, etc. Our XML language in the Web Languages Add-on does automated outlining but that also enforces proper well-formed XML structure to do so. HTML is loose (unless you do XHTML) and much trickier to do in that regard. To do HTML properly, you would need to build an AST of your document and drive automated outlining off that AST data similar to how we do in the SimpleSyntaxLanguage sample. It's not an easy or quick thing though due to the complexity of tag matching and handling of syntax errors.


Actipro Software Support

Posted 8 years ago by Radjesh Klauke - Mr., X-impress
Avatar
Thanks I understand.
The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.