From 594bbe4496b08f5647e16808a0ac39b436e5fbff Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Mon, 30 Jan 2017 12:55:25 +0400 Subject: [PATCH] Fix Android-like format triggers offset calc (#1333) --- app/js/lib/ng_utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index a3637cc4..6ac60b1c 100755 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -1442,14 +1442,14 @@ angular.module('izhukov.utils', []) length: text.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]) entities.push({ _: markdownEntities[match[7]], offset: matchIndex + match[6].length, length: text.length }) - rawOffset -= 2 + rawOffset -= match[7].length * 2 } else if (match[11]) { // custom mention newText.push(text) entities.push({