pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: godstanis@gmail.com
Subject: BUG #16097: ts_headline fails on text with html style tag
Date: Wed, 06 Nov 2019 15:28:28 +0000
Message-ID: <16097-4724fa53dd5a23d2@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16097
Logged by:          Stanislav B.
Email address:      godstanis@gmail.com
PostgreSQL version: 12.0
Operating system:   Linux. Ubuntu 18 and 16
Description:        

'ts_headline' function behaves really strang on text with '<style>' tags.

Scenario #1:
Set up: any text with <style> tag, containing any text under 2043 symbols;
Result: works as expected, no problems.

Scenario #2:
Set up: any text (use the sample code at the bottom of my message) with
<style> tag, containing any text (but more than 2043-2045 symbols);
Result: fails to process correctly, text with empty "<style><style>" tag
returned.

Scenario #3:
Set up: Take THE SAME setup from #2 scenario, but just rename "style" tag to
anything else, let's use "stylk". (You can take the sample code below and
change the tag);
Result: works as expected, no problems.

As you see, the problem occurs only if we use "style" tag here.

Here is the minimum sample code to reproduce the error:

>> CODE START
select ts_headline(
               '<h1>Ok</h1> <style type="text/css">.some-content {color:
grey} .some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} .some-content
{color: grey} .some-content {color: grey} .some-content {color: grey}
.some-content {color: grey} .some-content {color: grey} * {}</style> <p>Any
other content not affected</p>',
               'anything'::tsquery,
               'HighlightAll="1"'
           );
>>CODE END



Message-ID: <16097-4724fa53dd5a23d2@postgresql.org>
Permalink:  ../16097-4724fa53dd5a23d2@postgresql.org/
Also on:    postgresql.org/message-id/16097-4724fa53dd5a23d2@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, godstanis@gmail.com
  Subject: Re: BUG #16097: ts_headline fails on text with html style tag
  In-Reply-To: <16097-4724fa53dd5a23d2@postgresql.org>
  References: <16097-4724fa53dd5a23d2@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox