Skip to content

Commit

Permalink
Fix bug with double encoding of preview content. closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Oct 30, 2018
1 parent edbb073 commit ee1921d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. This project make usage of the [Yii Versioning Strategy](https://github.com/yiisoft/yii2/blob/master/docs/internals/versions.md). In order to read more about upgrading and BC breaks have a look at the [UPGRADE Document](UPGRADE.md).

## 1.0.4 (30. October 2018)

+ [#9](https://github.com/luyadev/luya-module-crawler/issues/9) Fix bug with double encoding of preview content.

## 1.0.3 (8. October 2018)

+ [#8](https://github.com/luyadev/luya-module-crawler/issues/8) Fix issue with utf8 chars for result previews.
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/models/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public static function encodeQuery($query)
public function preview($word, $cutAmount = 150)
{
$cut = StringHelper::truncateMiddle($this->content, $word, $cutAmount);

return StringHelper::highlightWord($cut, $word, '<span style="background-color:#FFEBD1; color:black;">%s</span>');
}

Expand Down Expand Up @@ -333,7 +333,7 @@ public function ngRestAttributeTypes()
'title' => 'text',
'language_info' => 'text',
'url_found_on_page' => 'text',
'content' => 'textarea',
'content' => ['textarea', 'encoding' => false],
'last_update' => 'datetime',
'added_to_index' => 'datetime',
];
Expand Down

0 comments on commit ee1921d

Please sign in to comment.