Browse Source

Fix Android-like format triggers offset calc (#1333)

master
Viktor Oreshkin 7 years ago committed by Igor Zhukov
parent
commit
594bbe4496
  1. 4
      app/js/lib/ng_utils.js

4
app/js/lib/ng_utils.js

@ -1442,14 +1442,14 @@ angular.module('izhukov.utils', [])
length: text.length length: text.length
}) })
rawOffset -= match[2].length + match[4].length rawOffset -= match[2].length + match[4].length
} else if (match[7]) { // code } else if (match[7]) { // code|italic|bold
newText.push(match[6] + text + match[9]) newText.push(match[6] + text + match[9])
entities.push({ entities.push({
_: markdownEntities[match[7]], _: markdownEntities[match[7]],
offset: matchIndex + match[6].length, offset: matchIndex + match[6].length,
length: text.length length: text.length
}) })
rawOffset -= 2 rawOffset -= match[7].length * 2
} else if (match[11]) { // custom mention } else if (match[11]) { // custom mention
newText.push(text) newText.push(text)
entities.push({ entities.push({

Loading…
Cancel
Save