mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-19 04:59:33 +01:00
editor: do not replace newlines with br when pasting
This commit is contained in:
committed by
Abdullah Atta
parent
42d0d42188
commit
511c40db5c
@@ -17,11 +17,10 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { encodeNonAsciiHTML } from "entities";
|
||||||
|
|
||||||
export function convertBrToParagraph(html: string) {
|
export function convertBrToParagraph(html: string) {
|
||||||
const doc = new DOMParser().parseFromString(
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
||||||
convertNewlinesToBr(html),
|
|
||||||
"text/html"
|
|
||||||
);
|
|
||||||
for (const br of doc.querySelectorAll("br")) {
|
for (const br of doc.querySelectorAll("br")) {
|
||||||
let paragraph = br.closest("p");
|
let paragraph = br.closest("p");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user