fixes for Hollywoo
This commit is contained in:
@@ -82,8 +82,9 @@
|
||||
(doFor ktxtElement (splitFileElements fileStream)
|
||||
(case ktxtElement
|
||||
((Block (objectWith source output))
|
||||
(set source (applySpecialChars source))
|
||||
(+= sourceText source)
|
||||
(dictSet interp.variables "source" (removeSpecialChars source))
|
||||
(dictSet interp.variables "source" source)
|
||||
(dictSet interp.variables "sourceLine" ->line (nth (source.split "\n") line))
|
||||
(dictSet interp.variables "R" re_flex.R)
|
||||
(+= outputText
|
||||
@@ -102,7 +103,7 @@
|
||||
((when (and
|
||||
(= sourceType (sourceFile.extension))
|
||||
(= outputType (outputFile.extension))
|
||||
(canConvert (removeSpecialChars source)))
|
||||
(canConvert (applySpecialChars source)))
|
||||
(objectWith sourceType outputType canConvert name))
|
||||
(dictSet validMap name c))
|
||||
(otherwise {})))
|
||||
@@ -118,7 +119,7 @@
|
||||
(let [conversions (validConversions conversions "${base}.${sourceExt}" "${base}.${outputExt}" element.source)]
|
||||
(when (= 1 (count conversions))
|
||||
(let [onlyConversion (first (collect (conversions.iterator)))]
|
||||
(set element.output (onlyConversion.convert (removeSpecialChars element.source)))))))))
|
||||
(set element.output (onlyConversion.convert (applySpecialChars element.source)))))))))
|
||||
(toString elements))))
|
||||
|
||||
(function :String insertSpecialChars [:String text]
|
||||
@@ -129,10 +130,4 @@
|
||||
((text.endsWith "\n")
|
||||
(+ (substr text 0 -1) "↵"))
|
||||
(true
|
||||
text))))
|
||||
|
||||
(function :String removeSpecialChars [:String text]
|
||||
(let [text (text.replace "\r" "")]
|
||||
(.replace
|
||||
(.replace text "¶" "\n\n")
|
||||
"↵" "\n")))
|
||||
text))))
|
@@ -67,7 +67,7 @@
|
||||
(when (= "Overwrite" overwrite)
|
||||
(withValueOrQuickPickMap chosenConversion conversions
|
||||
(whenLet [converted
|
||||
(try (chosenConversion.convert (KTxt2.removeSpecialChars source))
|
||||
(try (chosenConversion.convert (KTxt2.applySpecialChars source))
|
||||
(catch [e] (errorMessage "Conversion error: $e") null))]
|
||||
(makeEdit
|
||||
->edit (edit.replace document.uri (rangeFromStartEnd outputStart outputEnd) converted)))))))
|
||||
|
Reference in New Issue
Block a user