The default configuration allows some html tags to be used in the aggregated content. However, I just realized that these tags do not get automatically closed if the truncated version shortens the content before the closing tag of the actual content.

<div class="feed-item">
  <h3 class="feed-item-title">
    <a href="feed url" target="feeditems">Feed item title</a>
  </h3>
  <div class="feed-item-body">
    <p>some text which then ends with <strong>April 27-29, 201...  </div>
  <div class="feed-item-categories">
    Categories: <a href="/aggregator/categories/2">Faculty News</a>  </div>
</div>

Can't the content be checked for open tags with regular expressions and then closing tags could be added at the end of the feed item body? I unfortunately do not know regular expressions enough to suggest a solution, but I guess when the content is cleaned for non-allowed tags, it could make this extra check?

Cheers, J.

Comments

ParisLiakos’s picture

Version: 6.20 » 8.x-dev

Not sure if this bug exists in d8, but if yes, it should be fixed there first

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

I thought that this would be the same as #2714131: Trimmed body display format can result in faulty and chopped off HTML if "Correct faulty and chopped off HTML" is not activated on the text format and it just needed the 'Correct faulty or chopped off HTML' filter applied, but I can't reproduce it in 9.3. The issue occurs on the home page but not in the feed.

Markup in the body is:
<p><strong><em><a href="/">Text formats define how text is filtered for output and how HTML tags and other text is displayed, replaced, or removed. Improper text format configuration is a security risk. Learn more on the Filter module help page.</a></em></strong></p>

This gets output as trimmed to 100 characters in the feed with closing tags added:

              <div property="schema:text" class="field__item"><p><strong><em><a href="/">Text formats define how text is filtered for output and how HTML tags and</a></em></strong></p></div>

But since this is logged against aggregator maybe I'm misunderstanding. Surely though we won't be cleaning up content from outside sources?

longwave’s picture

I can't see where aggregator ever truncated the body text of an item - back in D6 it would truncate the title, but not the description field, of an imported feed. I think as this is so old and nobody has reported it since we should just close this.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Works for me :)