Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1054

No way to escape html markup but keep non-7 bit characters in generated output

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0-beta3
    • 1.3.0-rc1
    • wicket
    • None

    Description

      from Component#String getModelObjectAsString(Object):
      ==
      if (getFlag(FLAG_ESCAPE_MODEL_STRINGS))
      {
      // Escape it
      return Strings.escapeMarkup(modelString, false, true).toString();
      }
      return modelString;
      ==

      As you can see, we have two options.
      1) Output will be html-escaped and all non-7 bit characters will be replaced with &#....; codes.
      2) Nothing will be escaped.

      These might be enough for ASCII-speaking people but not very friendly for others.

      We need third option:
      escape html-sensitive characters (&, <, >, etc) and do not modify all other characters because it is very difficult to view html-escaped page source and search engines are not happy with it.

      This can be done by replacing if {} body with following code:
      return Strings.escapeMarkup(modelString, false, false).toString();

      Maybe some additional flag could be added in order to support such behavior?

      Hope this will be fixed.

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            slonopotamus Marat Radchenko
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: