It looks as though when using this module, if you are using the link ability, it is converting characters to their htmlentity code.

Example: In the body if you have "><&<><&" it would print as "&gt;&lt;&amp;&lt;&gt;&lt;&amp;"

To Test:

  1. In a content type display, select "smart trim" as the formatter.
  2. Select to link the content.
  3. Save the content display mode.
  4. Create a piece of content with "><&<><&"
  5. View the display mode and the content should be escaped properly.

To solve. I believe we just need to add array('html'=>TRUE), to the final link.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timodwhit’s picture

timodwhit’s picture

Issue summary: View changes
timodwhit’s picture

Status: Active » Needs review
timodwhit’s picture

Issue summary: View changes
rymcveigh’s picture

Status: Needs review » Reviewed & tested by the community

I tested this patch with simplytestme. Works great. Super simple fix that is good to go.

anfor’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
3.87 KB
3.87 KB

Since these characters are detected as HTML tags, isn't better to allow HTML tags using "Tags to preserve" settings ?
See my patch for dev version and stable version as well.

j2r’s picture

Added patch there for allowing html in more link -> https://www.drupal.org/node/2483401

icampana’s picture

I can confirm that patch at #6 solved the issue and didn't cause any trouble

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 3 year old patch in #6 to smart_trim.module does not apply to the latest smart_trim 7.x-1.x-dev and needs to be re-rolled.

Checking patch smart_trim.module...
error: while searching for:
        }

        // Process additional options (currently only HTML on/off)
        if (!empty($settings['trim_options'])) {
          if (!empty($settings['trim_options']['text'])) {
            // Strip tags
            $preserve_tags = !empty($settings['trim_preserve_tags']) ? $settings['trim_preserve_tags'] : '';
            $output = strip_tags(str_replace('<', ' <', $output), $preserve_tags);

            // Strip out line breaks

error: patch failed: smart_trim.module:53
error: smart_trim.module: patch does not apply
anfor’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
4.23 KB
3.54 KB

Patch rerolled

Chris Matthews’s picture