Thanks --- the div trick works fine as a workaround; I hadn't thought of that. Odd that the style is retained for a div and not for a paragraph, though. I wonder if there's a layer translating via something semantically equivalent to markdown. On Tue, 22 Oct 2019 at 18:11, John MacFarlane wrote: > > Pandoc conversions can, in general, lose information. > See the beginning of the manual. > > If you have a class on a div rather than a p, it should > carry through. So if you can modify the source document > accordingly, it may work. > > David Given writes: > > > I have a document in HTML which I'm trying to convert to EPUB, using a > > command line like this: > > > > pandoc -f html -t epub2 --metadata-file=meta.yaml input.html > > --self-contained -o output.epub --toc > > > > If my input file contains a paragraph with a CSS class like this: > > > >

text

> > > > ...then the class is stripped off in the output EPUB: > > > >

text

> > > > This is problematic as I need the class in order to format my text > > properly. Does anyone know why this happens and if there's any way to > stop > > it? > > > > (Additional context: I need the class because bare
elements get > > transformed into


paragraphs, which my CSS can't detect, so > if > > anyone can stop *that* conversion instead it'd work just as well.) > > > > -- > > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/44436778-58cb-4883-bd25-c85d32358a1e%40googlegroups.com > . > -- ┌─── http://www.cowlark.com ─── │ "I have always wished for my computer to be as easy to use as my │ telephone; my wish has come true because I can no longer figure out │ how to use my telephone." --- Bjarne Stroustrup -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CALgV52jLsZ7Ums2_QxceDOUEYWSB_e6zgmd%2BVgumS0f_WAmSww%40mail.gmail.com.