mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
FIX: Fast edit doesn’t work on content with certain characters (#20410)
Small js fix for fast edit to allow posts to save changes when the post contains apostrophes and quotation marks. Replaces unicode characters in text prior to saving the edit. Includes system tests for fast edit and introduces a new system spec component for fast edit usage.
This commit is contained in:
@ -39,9 +39,9 @@ function getQuoteTitle(element) {
|
||||
}
|
||||
|
||||
function fixQuotes(str) {
|
||||
// u+201c “
|
||||
// u+201d ”
|
||||
return str.replace(/[\u201C\u201D]/g, '"');
|
||||
// u+201c, u+201d = “ ”
|
||||
// u+2018, u+2019 = ‘ ’
|
||||
return str.replace(/[\u201C\u201D]/g, '"').replace(/[\u2018\u2019]/g, "'");
|
||||
}
|
||||
|
||||
export default Component.extend(KeyEnterEscape, {
|
||||
|
Reference in New Issue
Block a user