git.iko.soy/typeable/pandoc
on master help sign in
Don't print raw HTML in man output.

Resolves Issue #183. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1657 788f1e2b-df1e-0410-8736-df70ead52e1b

commit05436988950d271f8a55ee48b4d7794da9b40172 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 7 Dec 2009, 23:34 (17 years ago) parent5082b54
2 files changed+2−68
src/Text/Pandoc/Writers/Man.hs+2−2 tests/writer.man−66
src/Text/Pandoc/Writers/Man.hs+2−2
@@ -149,7 +149,7 @@ blockToMan opts (Para inlines) = do
149149 contents <- liftM vcat $ mapM (wrapIfNeeded opts (inlineListToMan opts)) $
150150 splitSentences inlines
151151 return $ text ".PP" $$ contents
152−blockToMan _ (RawHtml str) = return $ text str
152+blockToMan _ (RawHtml _) = return empty
153153blockToMan _ HorizontalRule = return $ text $ ".PP\n * * * * *"
154154blockToMan opts (Header level inlines) = do
155155 contents <- inlineListToMan opts inlines
@@ -312,7 +312,7 @@ inlineToMan opts (Math DisplayMath str) = do
312312 contents <- inlineToMan opts (Code str)
313313 return $ text ".RS" $$ contents $$ text ".RE"
314314inlineToMan _ (TeX _) = return empty
315−inlineToMan _ (HtmlInline str) = return $ text $ escapeCode str
315+inlineToMan _ (HtmlInline _) = return empty
316316inlineToMan _ (LineBreak) = return $ text "\n.PD 0\n.P\n.PD\n"
317317inlineToMan _ Space = return $ char ' '
318318inlineToMan opts (Link txt (src, _)) = do
tests/writer.man−66
@@ -439,45 +439,18 @@ sublist
439439.SH HTML Blocks
440440.PP
441441Simple block on one line:
442−<div>
443442foo
444−</div>
445−
446443.PP
447444And nested without indentation:
448−<div>
449−<div>
450−<div>
451445foo
452−</div>
453−</div>
454−<div>
455446bar
456−</div>
457−</div>
458−
459447.PP
460448Interpreted markdown in a table:
461−<table>
462−<tr>
463−<td>
464449This is \f[I]emphasized\f[]
465−</td>
466−<td>
467450And this is \f[B]strong\f[]
468−</td>
469−</tr>
470−</table>
471−
472−<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
473−
474451.PP
475452Here's a simple block:
476−<div>
477−
478453foo
479−</div>
480−
481454.PP
482455This should be a code block, though:
483456.PP
@@ -494,30 +467,11 @@ As should this:
494467\f[]
495468.PP
496469Now, nested:
497−<div>
498− <div>
499− <div>
500−
501470foo
502−</div>
503− </div>
504−</div>
505−
506471.PP
507472This should just be an HTML comment:
508−<!-- Comment -->
509−
510473.PP
511474Multiline:
512−<!--
513−Blah
514−Blah
515−-->
516−
517−<!--
518− This is another comment.
519−-->
520−
521475.PP
522476Code block:
523477.PP
@@ -526,8 +480,6 @@ Code block:
526480\f[]
527481.PP
528482Just plain comment, with trailing spaces on the line:
529−<!-- foo -->
530−
531483.PP
532484Code:
533485.PP
@@ -536,24 +488,6 @@ Code:
536488\f[]
537489.PP
538490Hr's:
539−<hr>
540−
541−<hr />
542−
543−<hr />
544−
545−<hr>
546−
547−<hr />
548−
549−<hr />
550−
551−<hr class="foo" id="bar" />
552−
553−<hr class="foo" id="bar" />
554−
555−<hr class="foo" id="bar">
556−
557491.PP
558492 * * * * *
559493.SH Inline Markup