Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Fixed problem that decodes text in first line #3

Open
wants to merge 4 commits into
base: fix/issue-1_treat-effective-characters
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dist/textAngular.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,13 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'

var _ensureContentWrapped = function(value) {
if (_blankTest(value)) return value;

// wrap first line in default tag not to detect as text
value = value.replace(
new RegExp(`(.*?)(<${attrs.taDefaultWrap}>.*)`),
`<${attrs.taDefaultWrap}>$1</${attrs.taDefaultWrap}>$2`
);

var domTest = angular.element("<div>" + value + "</div>");
//console.log('domTest.children().length():', domTest.children().length);
if (domTest.children().length === 0) {
Expand Down