@@ -7,7 +7,6 @@ const fse = require('fs-extra')
7
7
const escapeStringRegexp = require ( 'escape-string-regexp' )
8
8
const sander = require ( 'sander' )
9
9
import i18n from 'browser/lib/i18n'
10
- import { escapeHtmlCharacters } from '../../../lib/utils'
11
10
12
11
const STORAGE_FOLDER_PLACEHOLDER = ':storage'
13
12
const DESTINATION_FOLDER = 'attachments'
@@ -221,31 +220,6 @@ function migrateAttachments (markdownContent, storagePath, noteKey) {
221
220
}
222
221
}
223
222
224
- /**
225
- * @description Convert special characters between ```
226
- * @param {string[] } splitWithCodeTag Array of HTML strings separated by ```
227
- * @returns {string } HTML in which special characters between ``` have been converted
228
- */
229
- function escapeHtmlCharactersInCodeTag ( splitWithCodeTag ) {
230
- for ( let index = 0 ; index < splitWithCodeTag . length ; index ++ ) {
231
- const codeTagRequired = ( splitWithCodeTag [ index ] !== '\`\`\`' && index < splitWithCodeTag . length - 1 )
232
- if ( codeTagRequired ) {
233
- splitWithCodeTag . splice ( ( index + 1 ) , 0 , '\`\`\`' )
234
- }
235
- }
236
- let inCodeTag = false
237
- let result = ''
238
- for ( let content of splitWithCodeTag ) {
239
- if ( content === '\`\`\`' ) {
240
- inCodeTag = ! inCodeTag
241
- } else if ( inCodeTag ) {
242
- content = escapeHtmlCharacters ( content )
243
- }
244
- result += content
245
- }
246
- return result
247
- }
248
-
249
223
/**
250
224
* @description Fixes the URLs embedded in the generated HTML so that they again refer actual local files.
251
225
* @param {String } renderedHTML HTML in that the links should be fixed
@@ -607,7 +581,6 @@ function handleAttachmentLinkPaste (storageKey, noteKey, linkText) {
607
581
608
582
module . exports = {
609
583
copyAttachment,
610
- escapeHtmlCharactersInCodeTag,
611
584
fixLocalURLS,
612
585
generateAttachmentMarkdown,
613
586
handleAttachmentDrop,
0 commit comments