Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13976

Allow backslash-escaped line terminators in content token string arguments

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • email-ext-plugin
    • None

      The stringRegex field in ContentBuilder.Tokenizer disallows line terminators in content token arguments (see line #141 in ContentBuilder.java):

      // Sequence of (1) not \ " CR LF and (2) \ followed by non line terminator
      
      private static final String stringRegex = "\"([^\\\\\"\\r\\n]|(\\\\.))*\"";
      

      I propose allowing escaped line terminators, in the tradition of using backslashes as line continuation characters in various scripting languages, including Bash and Python:

      // Sequence of (1) not \ " CR LF and (2) \ followed by any non-CR/LF character or (CR)LF
      private static final String stringRegex = "\"([^\\\\\"\\r\\n]|(\\\\(?:.|\r?\n)))*\"";
      

            slide_o_mix Alex Earl
            sarowe Steve Rowe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: