We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25a606b commit 5913e02Copy full SHA for 5913e02
lib/PPC.pm
@@ -4,6 +4,8 @@ class PPC;
4
5
use builtin 'trim';
6
7
+use Pandoc;
8
+
9
field $author :param = '';
10
field $id :param;
11
field $slug :param;
@@ -51,7 +53,7 @@ sub new_from_file($class, $ppc_file) {
51
53
$ppc{slug} =~ s|\.md$||;
52
54
55
while (<$ppc_fh>) {
- $. == 1 and m|#\s+(.*)| and $ppc{title} = $1;
56
+ !$ppc{title} and m|^#\s+(.*)| and $ppc{title} = md2text($_);
57
58
$is_preamble and /## abstract/i and last;
59
@@ -77,4 +79,8 @@ sub new_from_file($class, $ppc_file) {
77
79
return $class->new(%ppc);
78
80
}
81
82
+sub md2text($md_string) {
83
+ return pandoc->convert( markdown => 'plain', $md_string);
84
+}
85
86
1;
0 commit comments