manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
8.94k stars 497 forks source link

Highlight with html_strip_mode corrupt the data #1737

Open donhardman opened 8 months ago

donhardman commented 8 months ago

When we highlight with stripping HTML we get data corrupted and converted to rendered entities instead of keeping original.

Expected:

&lt;?php echo "<b>hello world</b>";

Actual:

<?php echo "<b>hello</b> world"

MRE:

mysql> drop table if exists test; create table test (v text); insert into test (id,
v) values (1, '<code>&lt;?php echo "hello world";</code>'); select highlight({html_s
trip_mode=strip}) from test where match('hello');
+------------------------------------+
| highlight({html_strip_mode=strip}) |
+------------------------------------+
|  <?php echo "<b>hello</b> world";  |
+------------------------------------+
sanikolaev commented 8 months ago

@donhardman pls check if the retain mode helps.