summaryrefslogtreecommitdiff
path: root/pandoc-emphasis
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-03-19 13:09:12 +0100
committerJonas Smedegaard <dr@jones.dk>2015-03-19 13:10:55 +0100
commita51581fe892440b0aa49116b449b108484a6104a (patch)
tree0f6f72501c5a9b19bd032fedf752ea3370c83196 /pandoc-emphasis
parentf8f0101f55e6a1e80e803ab8bd0056ca22032634 (diff)
Adapt emphasis filter to expect and emit semantic Quoted (Not quote char in Str).
Diffstat (limited to 'pandoc-emphasis')
-rwxr-xr-xpandoc-emphasis13
1 files changed, 6 insertions, 7 deletions
diff --git a/pandoc-emphasis b/pandoc-emphasis
index 2d61514..97ddac0 100755
--- a/pandoc-emphasis
+++ b/pandoc-emphasis
@@ -85,23 +85,22 @@ sub emphasis {
if ( $self->name eq 'Emph' ) {
$window->set_view($self);
given ( stringify($self) ) {
- when (/^[^\"]+$/) {
+ when ( $self->content->[0]->name eq 'Str' ) {
if ( $window->peek_at_ledge() eq '"' ) {
$window->clear_ledge();
$title++;
-# FIXME: LaTeX-encode text
log_debug { 'emphasis →title: ' . $_ };
return $window->interpret_view(
- RawInline( 'latex',
- '\\title{' . $_ . '}' ));
+ Quoted( DoubleQuote,
+ $self->content ));
}
}
- when (/^\"([^\"]+)\"$/) {
-# FIXME: LaTeX-encode text
+ when ( $self->content->[0]->name eq 'Quoted' ) {
log_debug { 'emphasis →foreign: ' . $_ };
+ # FIXME: LaTeX-encode text
return $window->interpret_view(
RawInline( 'latex',
- '\\foreign{' . $1 . '}' ));
+ '\\foreign{' . $_ . '}' ));
}
}
return $window->describe_view();