summaryrefslogtreecommitdiff
path: root/src/generators/latex
diff options
context:
space:
mode:
Diffstat (limited to 'src/generators/latex')
-rw-r--r--src/generators/latex/text_g.cpp5
-rw-r--r--src/generators/latex/text_g.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/generators/latex/text_g.cpp b/src/generators/latex/text_g.cpp
index 015608d..90471ae 100644
--- a/src/generators/latex/text_g.cpp
+++ b/src/generators/latex/text_g.cpp
@@ -19,7 +19,7 @@ latex::text_g::text_g() : text_g::base_type(text_) {
using namespace ka;
using ka::standard_wide::char_;
- text_ = stext_ | ptext_;
+ text_ = stext_ | pstext_ | ptext_;
stext_ = &uint_(EMPH) << L"\\emph{" << +text_ << '}'
| &uint_(SEMPH) << L"\\textit{\\emph{" << +text_ << L"}}"
@@ -32,5 +32,8 @@ latex::text_g::text_g() : text_g::base_type(text_) {
| &uint_(QUOTE) << L"``" << +text_ << L"''"
| &uint_(SUB) << L"_{" << +text_ << '}';
+ pstext_ = &uint_(LINK) << L"\\href{" << ptext_[_1 = ph::at_c<2>(_val)]
+ << L"}{" << (+text_)[_1 = ph::at_c<1>(_val)] << '}';
+
ptext_ = +char_;
}
diff --git a/src/generators/latex/text_g.h b/src/generators/latex/text_g.h
index a2174e7..2d26a4d 100644
--- a/src/generators/latex/text_g.h
+++ b/src/generators/latex/text_g.h
@@ -16,15 +16,18 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef _MPPDOWN_LATEX_TEXT_G
#define _MPPDOWN_LATEX_TEXT_G
#include <boost/spirit/include/karma.hpp>
+#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/support_standard_wide.hpp>
#include "../../elements.h"
namespace ka = boost::spirit::karma;
+namespace ph = boost::phoenix;
namespace latex {
struct text_g : ka::grammar<oiterator, text_t()> {
ka::rule<oiterator, text_t()> text_;
ka::rule<oiterator, stext_t()> stext_;
+ ka::rule<oiterator, pstext_t()> pstext_;
ka::rule<oiterator, std::wstring()> ptext_;
text_g();