mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-03 08:11:50 +01:00
markdown styling changes in progress
This commit is contained in:
parent
8f58c95452
commit
68979015c1
5 changed files with 48 additions and 4 deletions
|
|
@ -1,8 +1,15 @@
|
|||
const cleanUpPrimaryKeyValue = (value) => {
|
||||
// For Bing convoId handling
|
||||
return value.replace(/--/g, '-');
|
||||
};
|
||||
|
||||
function replaceSup(text) {
|
||||
if (!text.includes('<sup>')) return text;
|
||||
const replacedText = text.replace(/<sup>/g, '^').replace(/\s+<\/sup>/g, '^');
|
||||
return replacedText;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
cleanUpPrimaryKeyValue,
|
||||
}
|
||||
replaceSup
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ const { MeiliSearch } = require('meilisearch');
|
|||
const { Message } = require('../../models/Message');
|
||||
const { Conversation, getConvosQueried } = require('../../models/Conversation');
|
||||
const { reduceHits } = require('../../lib/utils/reduceHits');
|
||||
const { cleanUpPrimaryKeyValue } = require('../../lib/utils/misc');
|
||||
const { replaceSup, cleanUpPrimaryKeyValue } = require('../../lib/utils/misc');
|
||||
const cache = new Map();
|
||||
|
||||
router.get('/sync', async function (req, res) {
|
||||
|
|
@ -46,7 +46,7 @@ router.get('/', async function (req, res) {
|
|||
return {
|
||||
...rest,
|
||||
searchResult: true,
|
||||
text: _formatted.text
|
||||
text: replaceSup(_formatted.text)
|
||||
};
|
||||
});
|
||||
const titles = (await Conversation.meiliSearch(q)).hits;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue