Skip to content

Commit

Permalink
Search: fix match highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Oct 10, 2024
1 parent 857ae5f commit 846ae56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/lib/api/document.xql
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ declare function dapi:get-fragment($request as map(*), $docs as node()*, $path a
$mapped
else
$xml?data
let $data :=
if (empty($request?parameters?xpath) and $request?parameters?highlight and exists(session:get-attribute($config:session-prefix || ".search"))) then
let $data :=
if (empty($request?parameters?xpath) and request:get-parameter('user.highlight', ()) and exists(session:get-attribute($config:session-prefix || ".search"))) then
query:expand($xml?config, $mapped)[1]
else
$mapped
Expand Down Expand Up @@ -521,9 +521,9 @@ declare function dapi:get-fragment($request as map(*), $docs as node()*, $path a
(),
"content": serialize($transformed?content,
<output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
<output:indent>no</output:indent>
<output:method>{$request?parameters?serialize}</output:method>
<output:omit-xml-declaration>yes</output:omit-xml-declaration>
<output:indent>no</output:indent>
<output:method>{$request?parameters?serialize}</output:method>
<output:omit-xml-declaration>yes</output:omit-xml-declaration>
</output:serialization-parameters>),
"footnotes": serialize($transformed?footnotes,
<output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization">
Expand Down

0 comments on commit 846ae56

Please sign in to comment.