Details

    • Number of attachments :
      0

      Description

      This rule is far too complex to use (too hard to configure its parameters properly), and it is much better to create indivual rules to replace it, which will work out of the box, with proper titles and descriptions.

        Activity

        Hide
        Dinesh Bolkensteyn added a comment -

        Done

        Show
        Dinesh Bolkensteyn added a comment - Done
        Hide
        Freddy Mallet added a comment -

        Works well Dinesh but I would update the title and description of this rule:

        • Title
          HTML tag contents should not match a given regular expression
        • Description
          This rule allows to check the content of HTML tags against a given regular expression. When the regular expression match this content an issue is logged with the given message.

        For example, expression can be set to <table.border=.> to find all 'table' HTML tags whose 'border' attribute is defined :

        <table>              <!-- Compliant -->
        <table border="1">   <!-- Non-Compliant -->
        <table width="100%" 
           border="0"        <!-- Non-Compliant -->
           cellspacing="10" 
           cellpadding="0">
        <table               <!-- Compliant -->
           id="globalResultQuery"
           cellspacing="0" 
           cellpadding="5" 
           width="100%">
        
        • Default issue message
          This tag content matches the given regular expression.
        Show
        Freddy Mallet added a comment - Works well Dinesh but I would update the title and description of this rule: Title HTML tag contents should not match a given regular expression Description This rule allows to check the content of HTML tags against a given regular expression. When the regular expression match this content an issue is logged with the given message. For example, expression can be set to <table. border=. > to find all 'table' HTML tags whose 'border' attribute is defined : <table> <!-- Compliant --> <table border= "1" > <!-- Non-Compliant --> <table width= "100%" border= "0" <!-- Non-Compliant --> cellspacing= "10" cellpadding= "0" > <table <!-- Compliant --> id= "globalResultQuery" cellspacing= "0" cellpadding= "5" width= "100%" > Default issue message This tag content matches the given regular expression.
        Hide
        Dinesh Bolkensteyn added a comment -

        I can update the title, but I'd rather no go with your example.
        The word 'contents' is misleading, if I have '<a>foo</a>', then is it contents '<a>foo</a>', 'foo' or 'a' or '<a>' ?

        The regular epxression you provide in the example will not produce the correct issues on the example snippet.

        The illegal attribute check is much more suitable for such a use case, where all you need to do is: table.border

        In fact I tend to think that this check should be removed.

        Show
        Dinesh Bolkensteyn added a comment - I can update the title, but I'd rather no go with your example. The word 'contents' is misleading, if I have '<a>foo</a>', then is it contents '<a>foo</a>', 'foo' or 'a' or '<a>' ? The regular epxression you provide in the example will not produce the correct issues on the example snippet. The illegal attribute check is much more suitable for such a use case, where all you need to do is: table.border In fact I tend to think that this check should be removed.
        Hide
        Dinesh Bolkensteyn added a comment -

        As discussed, we'll in fact remove this check which is too generic, and too complex to be used.

        It would be much better to implement the rules individually, rather than having one giant configurable rule which is supposed to cover all use cases.

        Show
        Dinesh Bolkensteyn added a comment - As discussed, we'll in fact remove this check which is too generic, and too complex to be used. It would be much better to implement the rules individually, rather than having one giant configurable rule which is supposed to cover all use cases.
        Hide
        Dinesh Bolkensteyn added a comment -

        Done

        Show
        Dinesh Bolkensteyn added a comment - Done
        Hide
        Freddy Mallet added a comment -

        Manually tested !

        Show
        Freddy Mallet added a comment - Manually tested !

          People

          • Assignee:
            Dinesh Bolkensteyn
            Reporter:
            David Racodon
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: