summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@fastmail.net>2010-12-04 22:04:54 +0100
committerGrégoire Duchêne <gduchene@fastmail.net>2010-12-04 22:04:54 +0100
commit753d309d6b51ef2f3dc13f93dbc8942ce80df57a (patch)
treeb046684700fcaf40ce5558101f45436f1c9d0eba
parent7d8e1295ff6bd4a768a658690b850d58aba01b0b (diff)
Alternate style text support added.
-rw-r--r--src/elements.h4
-rw-r--r--src/generators/latex/text_g.cpp4
-rw-r--r--src/parser/text_p.cpp6
3 files changed, 10 insertions, 4 deletions
diff --git a/src/elements.h b/src/elements.h
index 1c2f451..5f1bc5c 100644
--- a/src/elements.h
+++ b/src/elements.h
@@ -29,7 +29,9 @@ typedef boost::variant<boost::recursive_wrapper<stext_t>, std::wstring> text_t;
enum stattribute_t {
EMPH,
SEMPH,
- VSEMPH
+ VSEMPH,
+ ALT,
+ SALT
};
struct stext_t {
diff --git a/src/generators/latex/text_g.cpp b/src/generators/latex/text_g.cpp
index aeaffc0..0cc64cb 100644
--- a/src/generators/latex/text_g.cpp
+++ b/src/generators/latex/text_g.cpp
@@ -23,7 +23,9 @@ latex::text_g::text_g() : text_g::base_type(text_) {
stext_ = &uint_(EMPH) << L"\\emph{" << +text_ << '}'
| &uint_(SEMPH) << L"\\textit{\\emph{" << +text_ << L"}}"
- | &uint_(VSEMPH) << L"\\texttt{\\textit{\\emph{" << +text_ << L"}}}";
+ | &uint_(VSEMPH) << L"\\texttt{\\textit{\\emph{" << +text_ << L"}}}"
+ | &uint_(ALT) << L"\\texttt{" << +text_ << '}'
+ | &uint_(SALT) << L"\\texttt{\\textbf{" << +text_ << L"}}";
ptext_ = +char_;
}
diff --git a/src/parser/text_p.cpp b/src/parser/text_p.cpp
index 4d44e66..3546f5b 100644
--- a/src/parser/text_p.cpp
+++ b/src/parser/text_p.cpp
@@ -23,9 +23,11 @@ text_p::text_p() : text_p::base_type(text_) {
stext_ = lit("***") >> attr(VSEMPH) >> +text_ >> "***"
| lit("**") >> attr(SEMPH) >> +text_ >> "**"
- | lit('*') >> attr(EMPH) >> +text_ >> '*';
+ | lit('*') >> attr(EMPH) >> +text_ >> '*'
+ | lit("''") >> attr(SALT) >> +text_ >> "''"
+ | lit('\'') >> attr(ALT) >> +text_ >> '\'';
ptext_ = +(echar_ | rchar_);
echar_ = lit('\\') >> char_;
- rchar_ = char_ - char_(L"*");
+ rchar_ = char_ - char_(L"*'");
}