|
@@ -739,6 +739,22 @@
|
|
|
(and (= typ "Paragraph")
|
|
(and (= typ "Paragraph")
|
|
|
(every? #(= % ["Break_Line"]) break-lines)))
|
|
(every? #(= % ["Break_Line"]) break-lines)))
|
|
|
|
|
|
|
|
|
|
+(defn trim-paragraph-special-break-lines
|
|
|
|
|
+ [[typ paras]]
|
|
|
|
|
+ (println typ paras)
|
|
|
|
|
+ (when (= typ "Paragraph")
|
|
|
|
|
+ (let [indexed-paras (map-indexed vector paras)
|
|
|
|
|
+ ast [typ (->> (filter
|
|
|
|
|
+ #(let [[index value] %]
|
|
|
|
|
+ (not (and (> index 0)
|
|
|
|
|
+ (= value ["Break_Line"])
|
|
|
|
|
+ (contains? #{"Timestamp" "Macro"}
|
|
|
|
|
+ (first (nth paras (dec index)))))))
|
|
|
|
|
+ indexed-paras)
|
|
|
|
|
+ (map #(last %)))]]
|
|
|
|
|
+ ast)))
|
|
|
|
|
+
|
|
|
(defn trim-break-lines!
|
|
(defn trim-break-lines!
|
|
|
[ast]
|
|
[ast]
|
|
|
- (drop-while break-line-paragraph? ast))
|
|
|
|
|
|
|
+ (drop-while break-line-paragraph?
|
|
|
|
|
+ (map trim-paragraph-special-break-lines ast)))
|