summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/elements.h3
-rw-r--r--src/generators/latex/text_g.cpp2
-rw-r--r--src/parser/text_p.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/elements.h b/src/elements.h
index 5ea4534..0c7b1bf 100644
--- a/src/elements.h
+++ b/src/elements.h
@@ -35,7 +35,8 @@ enum stattribute_t {
QUOTE,
SUB,
LINK,
- NBSP
+ NBSP,
+ NEWLINE
};
struct stext_t;
diff --git a/src/generators/latex/text_g.cpp b/src/generators/latex/text_g.cpp
index e65d80d..cdebe9f 100644
--- a/src/generators/latex/text_g.cpp
+++ b/src/generators/latex/text_g.cpp
@@ -32,7 +32,7 @@ latex::text_g::text_g() : text_g::base_type(text_) {
| &uint_(QUOTE) << L"``" << +text_ << L"''"
| &uint_(SUB) << L"_{" << +text_ << '}';
- atom_ = &uint_(NBSP) << '~';
+ atom_ = &uint_(NBSP) << '~' | &uint_(NEWLINE) << L"\\\\" << eol;
pstext_ = &uint_(LINK) << L"\\href{" << ptext_[_1 = ph::at_c<2>(_val)]
<< L"}{" << (+text_)[_1 = ph::at_c<1>(_val)] << '}';
diff --git a/src/parser/text_p.cpp b/src/parser/text_p.cpp
index f833743..a632d97 100644
--- a/src/parser/text_p.cpp
+++ b/src/parser/text_p.cpp
@@ -37,7 +37,7 @@ text_p::text_p() : text_p::base_type(text_) {
pstext_ = lit('[') >> attr(LINK) >> +text_(val(L"]")) >> ']' >>
lit('(') >> ptext_(val(L")")) >> ')';
- atom_ = lit(L"\\ ") >> attr(NBSP);
+ atom_ = lit(L"\\ ") >> attr(NBSP) | lit('\\') >> eol >> attr(NEWLINE);
ptext_ = +(echar_ | rchar_(_r1));
echar_ = lit('\\') >> ~char_(' ');