Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: strip html and show text #22656

Merged
merged 2 commits into from Oct 10, 2023
Merged

Conversation

maharshivpatel
Copy link
Collaborator

Quill editor adds html which is useless for user so strip html using html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).

Before

Before.Fix.quill.mov

After

After.fix.quill.mov

Quill editor adds html which is useless for user so strip html using  html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).
@maharshivpatel maharshivpatel requested a review from a team as a code owner October 8, 2023 11:53
@maharshivpatel maharshivpatel requested review from surajshetty3416 and ankush and removed request for a team October 8, 2023 11:53
@git-avc
Copy link
Contributor

git-avc commented Oct 8, 2023

Hi:

It will fix #22547 and #22632
Could you provide translatable text for "No text found in ..."?

Thanks!

link.textContent = value.toString();
// "Text Editor" and some other fieldtypes can have html tags in them so strip and show text.
// If no text is found show "No Text Found in {Field Label}"
let textValue = frappe.utils.html2text(value) || "No Text Found in " + subject_field.label;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it empty if no text is found instead of "No Text Found in" since it'll be hard to distinguish among other text.

We can show "[image]" for images in the description?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving it blank will be confusing to users on where to click?

@ankush ankush merged commit 7752136 into frappe:develop Oct 10, 2023
1 of 2 checks passed
mergify bot pushed a commit that referenced this pull request Oct 10, 2023
* fix: strip html and show text

Quill editor adds html which is useless for user so strip html using  html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).

* fix: remove placeholder text

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 7752136)
mergify bot pushed a commit that referenced this pull request Oct 10, 2023
* fix: strip html and show text

Quill editor adds html which is useless for user so strip html using  html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).

* fix: remove placeholder text

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 7752136)
ankush pushed a commit that referenced this pull request Oct 10, 2023
* fix: strip html and show text

Quill editor adds html which is useless for user so strip html using  html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).

* fix: remove placeholder text

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 7752136)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
ankush pushed a commit that referenced this pull request Oct 10, 2023
* fix: strip html and show text

Quill editor adds html which is useless for user so strip html using  html2text and render Text only. If no text is found it will render No Text Found in + "Field Label" (ex. Description).

* fix: remove placeholder text

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 7752136)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request Oct 11, 2023
# [14.52.0](v14.51.0...v14.52.0) (2023-10-11)

### Bug Fixes

* add rate limiting and type hints for `add_feedback` ([9049a4f](9049a4f))
* allow larger URLs in Integration Request ([844fd76](844fd76))
* Apply address all perm only if owner ([de7f13f](de7f13f))
* avoid double translation ([fda329f](fda329f))
* changed table style to match grid style ([7e77bea](7e77bea))
* conditional webform with list view enabled ([45be3d3](45be3d3))
* Escape filename in sidebar ([8a9728c](8a9728c))
* Fix breakpoints CSS variables using map-get ([2fadf43](2fadf43))
* Give All role permission to read/create own address and contact ([#22642](#22642)) ([e4a7577](e4a7577))
* improved validation for address and contact ([ef5709a](ef5709a))
* keyerror on reports with subtotal ([6562139](6562139))
* no perm if doc doesn't exist ([d283b55](d283b55))
* strip html and show text ([#22656](#22656)) ([#22677](#22677)) ([55c0602](55c0602))
* **UX:** Bring responsive multi-column design to module and role editors ([3bcf15d](3bcf15d))
* **UX:** Responsive, column-major design for multicheck elements. ([5fc944a](5fc944a))

### Features

* bulk update fields select sorted by translated labels ([#22318](#22318)) ([65122b4](65122b4))
frappe-pr-bot pushed a commit that referenced this pull request Oct 17, 2023
## [13.58.13](v13.58.12...v13.58.13) (2023-10-17)

### Bug Fixes

* Apply address all perm only if owner ([f6105df](f6105df))
* avoid double translation (backport [#22578](#22578)) ([2c267ea](2c267ea))
* improved validation for address and contact (backport [#22574](#22574)) ([45c5756](45c5756))
* strip html and show text ([#22656](#22656)) ([#22676](#22676)) ([d371d59](d371d59))
* validation permission on `tag` creation ([#22753](#22753)) ([#22754](#22754)) ([6247aa0](6247aa0))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2023
@maharshivpatel maharshivpatel deleted the fix-quill-html2text branch December 27, 2023 08:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants