Problem/Motivation

The “HTML Filter” processor doesn’t work as expected with regard to the set HTML tags (even with the default tags). Specifically, the tags for HTML headings (<h1>, <h2>, <h3>, …) do not work.

Proposed resolution

The cause of the problem is a bad regular expression for matching HTML tags in the input: '#^(/?)([-:_a-zA-Z]+)#'

I propose to change the regular expression to the following (see also the patch that I will attach in a minute): '#^(/?)([:_a-zA-Z][-:_a-zA-Z0-9.]*)#'

Remaining tasks

Someone with more insight into the module should review my patch. Perhaps some kind of unit test would be useful, too.

User interface changes

N/A

API changes

There are no changes to the API. Perhaps module users should update their search indexes after this change, though.

Comments

cspurk’s picture

Status: Active » Needs review
StatusFileSize
new564 bytes
Yaron Tal’s picture

Issue summary: View changes

Took me a while to figure this out. Will try to create a test to get this moving again.

Yaron Tal’s picture

Added a test-only and fix patch that apply to the latest dev.

The last submitted patch, 3: html_filter_processor-1889940-3-test-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 3: html_filter_processor-1889940-3-complete.patch, failed testing.

Yaron Tal’s picture

Forgot adding the h3 score to the test. New set of patches.

Yaron Tal’s picture

Status: Needs work » Needs review

The last submitted patch, 6: html_filter_processor-1889940-6-test-only.patch, failed testing.

eelkeblok’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed the patch and it looks good to me.

  • drunken monkey committed 7a0b612 on 7.x-1.x authored by cspurk
    Issue #1889940 by cspurk, Yaron Tal: Fixed "HTML filter" processor to...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Oh, sorry for not seeing this earlier! Thanks for reviving that, and then even providing test coverage – awesome!
Committed the patch now.
Thanks again, everyone, and my apologies for the (considerable) delay!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.