From 5f8d66559a8f64669a7ec8aa7f444090d21faed5 Mon Sep 17 00:00:00 2001 From: Mr K <86073200+mdrezak@users.noreply.github.com> Date: Fri, 17 May 2024 20:45:14 -0700 Subject: [PATCH] fix short description reflection by content problem. the problem is content: '

header

text

' reflected description: headertext but correct description is : header text and I fix it by add a space and new line at the end of all block html tag --- .../Pages/CmsKit/BlogPosts/create.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js index 1b3bd0b7f4a..5011c904035 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js @@ -213,8 +213,12 @@ $(function () { if (shorDescriptionEdited) { return; } - - var plainValue = jQuery('
').html(htmlContent).text().replace(/\n/g, ' ').substring(0, 120); + + var htmlValue = jQuery('
').html(htmlContent); + htmlValue[0].querySelectorAll( + "div, p, h1, h2, h3, h4, h5, h6, ul, ol, pre, address, blockquote, dl, fieldset, form, hr, menu, table" + ).forEach(x => x.innerText += " \n"); + var plainValue = htmlValue.text().replace(/\n/g, ' ').substring(0, 120); $shortDescription.val(plainValue); }