From 4517a22ab187aee3b79476d578dc938c8508aa25 Mon Sep 17 00:00:00 2001 From: Anika Churilova Date: Thu, 19 Sep 2024 17:16:31 +0200 Subject: [PATCH] search results: render Mathjax in the requests results list * closes https://github.com/CERNDocumentServer/cds-rdm/issues/198 --- .../js/invenio_requests/search/RequestsResults.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js b/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js index 3fda59fa..02ef80e7 100644 --- a/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js +++ b/invenio_requests/assets/semantic-ui/js/invenio_requests/search/RequestsResults.js @@ -7,7 +7,7 @@ import { InvenioSearchPagination } from "@js/invenio_search_ui/components"; import { i18next } from "@translations/invenio_requests/i18next"; import PropTypes from "prop-types"; -import React from "react"; +import React, { useCallback } from "react"; import { Count, ResultsList, Sort } from "react-searchkit"; import { Grid, Segment } from "semantic-ui-react"; @@ -17,6 +17,10 @@ export const RequestsResults = ({ currentResultsState, }) => { const { total } = currentResultsState.data; + + const handleMathjaxCallback = useCallback(() => { + window.MathJax?.typeset(); + }, []); return ( total && ( @@ -55,7 +59,7 @@ export const RequestsResults = ({ - +