Posted 18 years ago by Martin Lamothe
Avatar
www.yahoo.com

If you take the page source code of www.yahoo.com and get the SyntaxEditor to parse it, it breaks down at line 669.

FireFox seems to highlight the HTML properly.

Any idea on what the problem is?

Comments (10)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
They have an open /* comment that they never close within that script block.


Actipro Software Support

Posted 18 years ago by Martin Lamothe
Avatar
How do we go about getting SyntaxEditor to ignore unclosed javascript comments or to be more flexible when it comes to non-html characters so that the remainder of the HTML document is properly rendered?

Basically, I'm looking to get something similar to what happens when we View Page Source using FireFox.

I checked with Dreamweaver and it's also able to continue without any rendering problems.

Is this a bug in the HTML language parser?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

In the JScript language definition tell the multiline comment to break on a < character so it can escape the language if appropriate. This fixes it:
<!-- Patterns Groups -->
<PatternGroups>
    <RegexPatternGroup TokenKey="MultiLineCommentDefaultToken" PatternValue="[^\*&lt;]+" />
</PatternGroups>


Actipro Software Support

Posted 18 years ago by Martin Lamothe
Avatar
Thanks for your prompt reply.

My company did not purchase the 1 year support license yet, due to financial restrictions.

In the future if other parsing problems are found, where to they fall in the licensing agreement? Are they considered problems (bugs) with the component or do they fall outside of the component functionality itself?

We are using your SyntaxEditor for heavy HTML manipulation. Could we agree that our company is in a way "testing" your HTML patterngroups and that any problems that we find would be fixed at no cost as both our actions are mutually beneficial?


Looking forward to your reply,
Martin
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

The language definition XML files are considered samples for you to modify as you like and not really part of the product itself. But of course if there is something wrong with them, we'd like to hear about it so that we can get it fixed. We have to prioritize those sorts of changes depending on the complexity of the change and how busy we are. So if you do find anything, continue to let us know and we'll try to get it resolved as soon as we can. Thanks.


Actipro Software Support

Posted 18 years ago by Martin Lamothe
Avatar
Understood.

Thank you.
Posted 18 years ago by Martin Lamothe
Avatar
Hi,


I've found another syntax issue with Jscripts.

http://www.yahoo.com

It seems as though this is the offending line.

var _ans = '
  • <a href=r/1l/*-http://answers.yahoo.com/_ylc=X3oDMTEycW5hc3E3BF9TAzI3MTYxNDkEc2VjA2ZwLXNyY2hib3gEc2xrA2xpbms-/ class=beta>Answers</a>
  • ';

    It seems as though the parser recognizes the "/*" character combination as the begining of a comment, however that text is contained in the variable.

    Thanks for your help with this.

    -Martin
    Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
    Avatar
    Good catch, it looks like we didn't include a definition for single quote strings in our JScript language definition. We only had double quote strings defined.

    Add this code to the JScript language defintion. Delete the current StringState and change the StringState child state reference in DefaultState to call the two states defined below instead.
    <!-- Single-Quote Strings -->
    <State Key="SingleQuoteStringState" TokenKey="SingleQuoteStringDefaultToken" Style="StringDefaultStyle">
        <!-- Scopes -->
        <Scopes>
            <Scope>
                <ExplicitPatternGroup Type="StartScope" TokenKey="SingleQuoteStringStartToken" Style="StringDelimiterStyle" PatternValue="'" />
                <ExplicitPatternGroup Type="EndScope" TokenKey="SingleQuoteStringEndToken" Style="StringDelimiterStyle" PatternValue="'" />    
            </Scope>
        </Scopes>
        <!-- Patterns Groups -->
        <PatternGroups>
            <RegexPatternGroup TokenKey="SingleQuoteStringEscapedCharacterToken" PatternValue="\\." />
            <RegexPatternGroup TokenKey="SingleQuoteStringDefaultToken" PatternValue="[^\\\']+" />
        </PatternGroups>
    </State>
    
    <!-- Double-Quote Strings -->
    <State Key="DoubleQuoteStringState" TokenKey="DoubleQuoteStringDefaultToken" Style="StringDefaultStyle">
        <!-- Scopes -->
        <Scopes>
            <Scope>
                <ExplicitPatternGroup Type="StartScope" TokenKey="DoubleQuoteStringStartToken" Style="StringDelimiterStyle" PatternValue="&quot;" />
                <ExplicitPatternGroup Type="EndScope" TokenKey="DoubleQuoteStringEndToken" Style="StringDelimiterStyle" PatternValue="&quot;" />    
            </Scope>
        </Scopes>
        <!-- Patterns Groups -->
        <PatternGroups>
            <RegexPatternGroup TokenKey="DoubleQuoteStringEscapedCharacterToken" PatternValue="\\." />
            <RegexPatternGroup TokenKey="DoubleQuoteStringDefaultToken" PatternValue="[^\\\&quot;]+" />
        </PatternGroups>
    </State>


    Actipro Software Support

    Posted 18 years ago by Martin Lamothe
    Avatar
    Hi,

    Can you post the fixed JScript language file.

    I'm having problems making the changes.

    Thanks,
    Martin
    Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
    Avatar
    Hi Martin,

    Send us an email and we'll reply with it.


    Actipro Software Support

    The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

    Add Comment

    Please log in to a validated account to post comments.