asciidoc/asciidoc-newline.patch

29 lines
1.5 KiB
Diff

From 89ac0f48affb054226467b58f5af524ae0760d62 Mon Sep 17 00:00:00 2001
From: "Christopher K. Hoadley" <chris.hoadley@gmail.com>
Date: Sat, 5 Dec 2020 10:59:36 -0600
Subject: [PATCH] Use config Newline Setting In System Attribute Evaluation
(#154)
Problems seen with inconsistent newlines in the Table Of Contents HTML pulled in from the configuration file. While the rest of the contents in the resulting HTML file honored the newline style configured by the user, this specific snippet of HTML always used "\r\n".
This root of this problem existed for some time, but in earlier versions, the newline style was always "\n". The symptoms changed as a side effect of the issue "Extra line padding in source and literal blocks" (#139). In this issue, the newline style changed to "\r\n", and was noticed by users.
Change the System Attribute Evaluation function to use the newline setting from the global "config" instead of using the default newline.
---
asciidoc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/asciidoc.py b/asciidoc.py
index 5c6b08b3..c33708c9 100755
--- a/asciidoc.py
+++ b/asciidoc.py
@@ -969,7 +969,7 @@ def system(name, args, is_macro=False, attrs=None):
line = subs_attrs(line)
if line is not None:
result.append(line)
- result = DEFAULT_NEWLINE.join(result)
+ result = config.newline.join(result)
else:
assert False
if result and name in ('eval3', 'sys3'):