From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14744 Path: news.gmane.org!not-for-mail From: Matt Haggard Newsgroups: gmane.text.pandoc Subject: Re: Can I eliminate newlines between elements in generated HTML? Date: Fri, 8 Apr 2016 15:53:59 -0700 (PDT) Message-ID: <6f4ab6c8-8a5d-4ebc-99c0-f6c55bbcb024@googlegroups.com> References: <5f012215-b6af-4fa3-b8a7-e8ba2b51ac9b@googlegroups.com> <20160408215335.GA61469@MacBook-Air-2.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_583_824962280.1460156039294" X-Trace: ger.gmane.org 1460156044 32154 80.91.229.3 (8 Apr 2016 22:54:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 22:54:04 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDDMH3V6RIBRBB7NUC4AKGQEFW5FBLY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Apr 09 00:54:01 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yw0-f184.google.com ([209.85.161.184]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aofHt-0006eX-6W for gtp-pandoc-discuss@m.gmane.org; Sat, 09 Apr 2016 00:54:01 +0200 Original-Received: by mail-yw0-f184.google.com with SMTP id k197sf39720989ywe.0 for ; Fri, 08 Apr 2016 15:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=RqRL7k/GmLd6/aNyZLBHFrAkFSV5fkdszy9BPz0vDMw=; b=qEe3LbtDvFyClSJrAeVQp3Ce2k8YlngYQ7MQJuqki1cXFVULxI/AbiO29a4uZ2P7T3 pnwfiEIuE+NPSgaojMsxtA35qdQPIR51FXL21/pfOR9QeJp4wlKKq9+dvn2siVVNbCyt xlBOaT/MCwtoHKOzOpcsFy3e4xReRi5NC4RBmhtRkKIlvYdP3SXScf0CmzxbfIx3M9xo ON1xFkjsvEtR9YpROnZf05GJa7WZI41XeTuoGlgZfYy9odf3foVtaeIX2MPrmw4MYtDx FFRi/M40nYBADETAI9ZAJdAhAsh65bvVOIsR2xKUrR42yCIGPy9IFGmbWesoZ+DNW+gg TpKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=RqRL7k/GmLd6/aNyZLBHFrAkFSV5fkdszy9BPz0vDMw=; b=bbc5z0elDD1O5uwkfv0d8HIRPmUe+R7BVvfSw4hy0O2Z+AK6r3taDRYU6pUBjLCW9H B7S4RxjD4usD0gEYolKnPMiWPflckx62uzHl1ZgnqP71EKOCQeyVM4Xm4CsNyBrM9Und Wopf/tTkrdm00VN8HS2uRXo42Z6P9baliiQvfP43SP9opZFpFEmHGYFYPM5P3iHLq3/E gH5sincssIQ/I3hAgOjUAdhL0Op8QPBntq0be8ZQvZjQ+jZhTBoIuKbxRdlWM3Wqhdwe EKGu+U5sfKXk5GKdetFHmt9zu9cq0xSRQ4mqhjKvCS8ac2+EQgfvjVXoixhVVsOsVps2 DFow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=RqRL7k/GmLd6/aNyZLBHFrAkFSV5fkdszy9BPz0vDMw=; b=cQM/G0A05QwhpGWswA7cfWxHge2edtMi5r/LNVpw4Xb7k/PGua+nA4dzc9yeggHLNg 7VPdIAGYEgcYvJOXvO76WogC9CrdEjyA9vdDZ7VDG2fMR8Mj2fi2recIP7ls5oKQlSR6 TR0eFvHwH/CWcDjTq1NCGAUR629DMgT8VIeNZHEs3I9JGGgs/mC0V9wmjbz/L9HYqsdr 6bkzAZfvOUTnmVFtCraYAQDYDj0f/hSQZ1HM6UMrQvpivCv7F3QxHD140ABdpsafZpth Ne2AKTcVFwXFv20LuLcyWmZrhTVAW6qfWUZZiju2XZTZbJOZTLnIMyxuXD/GcWc1+jk3 2Gpg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AD7BkJKOU9hSyvrBCk2UOSUNQTFEjcyofZnZU4NYEzELoCM9dUIaFkKi5zg4SDUb6BQKQQ== X-Received: by 10.182.24.67 with SMTP id s3mr135156obf.12.1460156040308; Fri, 08 Apr 2016 15:54:00 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.2.42 with SMTP id 39ls568770otb.91.gmail; Fri, 08 Apr 2016 15:53:59 -0700 (PDT) X-Received: by 10.157.4.47 with SMTP id 44mr134606otc.18.1460156039637; Fri, 08 Apr 2016 15:53:59 -0700 (PDT) In-Reply-To: <20160408215335.GA61469-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org> X-Original-Sender: haggardii-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:14744 Archived-At: ------=_Part_583_824962280.1460156039294 Content-Type: multipart/alternative; boundary="----=_Part_584_286878029.1460156039294" ------=_Part_584_286878029.1460156039294 Content-Type: text/plain; charset=UTF-8 We're on 1.15.0.6 which doesn't have --wrap=none but DOES have --no-wrap, which works. Thank you! (I don't really think of this is case as "wrapping" so didn't think to search for that) On Friday, April 8, 2016 at 3:53:50 PM UTC-6, John MacFarlane wrote: > > Did you try > > pandoc --wrap=none > > > +++ Matt Haggard [Apr 08 16 09:40 ]: > > I've found a solution that I like (and doesn't involve complicating > > pandoc). > > pip install htmlmin > > echo -e > > > '
hello
world
' > > | pandoc -t html5 | htmlmin -s > > To answer your question: > > We write markdown by hand, which contains code blocks full of custom > > elements (for highlighting). Our custom format is bold > > within the codeblock. Using a pandoc filter, those custom blocks get > > turned into this HTML: > >
bold
> > We then use http://www.princexml.com/ to convert from HTML to a PDF. > > Thanks! > > On Friday, April 8, 2016 at 10:35:10 AM UTC-6, Matthew Pickering > wrote: > > > > Can you please describe what you are doing? You mention that you're > > going markdown -> html -> pdf (why?) > > The answer to your question is that pre is a block level element and > > pandoc inserts newlines after each block from what I remember. > > On Fri, Apr 8, 2016 at 5:24 PM, Matt Haggard <[1]hagg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Bah... google groups messed up the newlines, but maybe you get the > > idea? > > > > > > On Friday, April 8, 2016 at 10:23:55 AM UTC-6, Matt Haggard wrote: > > >> > > >> I have a filter that adds elements to code blocks (for bolding, > > italics, > > >> etc.). We go markdown -> html -> pdf and have noticed that > > sometimes there > > >> is an extra erroneous space between these custom elements in the > > final PDF. > > >> This breaks copying and pasting. > > >> > > >> It's because pandoc adds newlines between some elements in the > > generated > > >> HTML. This shows and example: > > >> > > >> echo -e > > >> '
hello
world >     pre>
' | > > >> pandoc -t html5 > > >> > > >>
> > >> > > >>
hello
> > >> > > >>
world
> > >> > > >>
> > >> > > >> > > >> Is there a way I can get the output of the above to instead be > > this? (or > > >> even match the original input string) > > >> > > >> echo -e > > >> '
hello
world >     pre>
' | > > >> pandoc -t html5 > > >> > > >>
> > >> > > >>
hello
world
> > >> > > >>
> > >> > > >> > > >> Thank you! > > > > > > -- > > > 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 [2]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To post to this group, send email to [3]pandoc-...@googlegroups. > > com. > > > To view this discussion on the web visit > > > [4]https://groups.google.com/d/msgid/pandoc-discuss/5f012215- > > b6af-4fa3-b8a7-e8ba2b51ac9b%40googlegroups.com. > > > > > > For more options, visit [5]https://groups.google.com/d/optout. > > > > -- > > 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 [6]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To post to this group, send email to > > [7]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To view this discussion on the web visit > > [8] > https://groups.google.com/d/msgid/pandoc-discuss/b5fcdda1-aac1-4390- > > 84ee-18d745e7a06c%40googlegroups.com. > > For more options, visit [9]https://groups.google.com/d/optout. > > > >References > > > > 1. javascript:/ > > 2. javascript:/ > > 3. javascript:/ > > 4. > https://groups.google.com/d/msgid/pandoc-discuss/5f012215-b6af-4fa3-b8a7-e8ba2b51ac9b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 5. https://groups.google.com/d/optout > > 6. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 7. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 8. > https://groups.google.com/d/msgid/pandoc-discuss/b5fcdda1-aac1-4390-84ee-18d745e7a06c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer > > 9. https://groups.google.com/d/optout > > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6f4ab6c8-8a5d-4ebc-99c0-f6c55bbcb024%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_584_286878029.1460156039294 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We're on 1.15.0.6 which doesn't have --wrap=3Dnone= but DOES have --no-wrap, which works. =C2=A0Thank you! =C2=A0(I don't = really think of this is case as "wrapping" so didn't think to= search for that)

On Friday, April 8, 2016 at 3:53:50 PM UTC-6, John= MacFarlane wrote:
Did you try

=C2=A0 =C2=A0 pandoc --wrap=3Dnone


+++ Matt Haggard [Apr 08 16 09:40 ]:
> =C2=A0 I've found a solution that I like (and doesn't invo= lve complicating
> =C2=A0 pandoc).
> =C2=A0 =C2=A0 =C2=A0 pip install htmlmin
> =C2=A0 =C2=A0 =C2=A0 echo -e
> =C2=A0 '<div><pre><code>hello</code>&l= t;/pre><pre><code>world</code></pre>&l= t;/div>'
> =C2=A0 | pandoc -t html5 | htmlmin -s
> =C2=A0 To answer your question:
> =C2=A0 We write markdown by hand, which contains code blocks full = of custom
> =C2=A0 elements (for highlighting). =C2=A0Our custom format is <= ;r:b>bold</r:b>
> =C2=A0 within the codeblock. =C2=A0Using a pandoc filter, those cu= stom blocks get
> =C2=A0 turned into this HTML:
> =C2=A0 =C2=A0 =C2=A0 <pre class=3D"bold"><code&= gt;bold</code></pre>
> =C2=A0 We then use http://www.princexml.com/ to convert from HTML to a PDF.
> =C2=A0 Thanks!
> =C2=A0 On Friday, April 8, 2016 at 10:35:10 AM UTC-6, Matthew Pick= ering wrote:
>
> =C2=A0 =C2=A0 Can you please describe what you are doing? You ment= ion that you're
> =C2=A0 =C2=A0 going markdown -> html -> pdf (why?)
> =C2=A0 =C2=A0 The answer to your question is that pre is a block l= evel element and
> =C2=A0 =C2=A0 pandoc inserts newlines after each block from what I= remember.
> =C2=A0 =C2=A0 On Fri, Apr 8, 2016 at 5:24 PM, Matt Haggard <[1]= hagg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> =C2=A0 =C2=A0 wrote:
> =C2=A0 =C2=A0 > Bah... google groups messed up the newlines, bu= t maybe you get the
> =C2=A0 =C2=A0 idea?
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > On Friday, April 8, 2016 at 10:23:55 AM UTC-6, = Matt Haggard wrote:
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> I have a filter that adds elements to code = blocks (for bolding,
> =C2=A0 =C2=A0 italics,
> =C2=A0 =C2=A0 >> etc.). =C2=A0We go markdown -> html ->= ; pdf and have noticed that
> =C2=A0 =C2=A0 sometimes there
> =C2=A0 =C2=A0 >> is an extra erroneous space between these c= ustom elements in the
> =C2=A0 =C2=A0 final PDF.
> =C2=A0 =C2=A0 >> This breaks copying and pasting.
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> It's because pandoc adds newlines betwe= en some elements in the
> =C2=A0 =C2=A0 generated
> =C2=A0 =C2=A0 >> HTML. =C2=A0This shows and example:
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> echo -e
> =C2=A0 =C2=A0 >> '<div><pre><code>hell= o</code></pre><pre><code>world</code><= ;/
> =C2=A0 =C2=A0 pre></div>' |
> =C2=A0 =C2=A0 >> pandoc -t html5
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> <div>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> <pre><code>hello</code>&l= t;/pre>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> <pre><code>world</code>&l= t;/pre>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> </div>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> Is there a way I can get the output of the = above to instead be
> =C2=A0 =C2=A0 this? =C2=A0(or
> =C2=A0 =C2=A0 >> even match the original input string)
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> echo -e
> =C2=A0 =C2=A0 >> '<div><pre><code>hell= o</code></pre><pre><code>world</code><= ;/
> =C2=A0 =C2=A0 pre></div>' |
> =C2=A0 =C2=A0 >> pandoc -t html5
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> <div>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> <pre><code>hello</code>&l= t;/pre><pre><code>world</code></pre>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> </div>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >>
> =C2=A0 =C2=A0 >> Thank you!
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > --
> =C2=A0 =C2=A0 > You received this message because you are subsc= ribed to the Google
> =C2=A0 =C2=A0 Groups
> =C2=A0 =C2=A0 > "pandoc-discuss" group.
> =C2=A0 =C2=A0 > To unsubscribe from this group and stop receivi= ng emails from it,
> =C2=A0 =C2=A0 send an
> =C2=A0 =C2=A0 > email to [2]pandoc-discus...@googlegrou= ps.com.
> =C2=A0 =C2=A0 > To post to this group, send email to [3]pandoc-= ...@googlegroups.
> =C2=A0 =C2=A0 com.
> =C2=A0 =C2=A0 > To view this discussion on the web visit
> =C2=A0 =C2=A0 > [4]https://groups.googl= e.com/d/msgid/pandoc-discuss/5f012215-
> =C2=A0 =C2=A0 b6af-4fa3-b8a7-e8ba2b51ac9b%40googlegroups.com.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > For more options, visit [5]https://groups.google.com/d/optout.
>
> =C2=A0 --
> =C2=A0 You received this message because you are subscribed to the= Google
> =C2=A0 Groups "pandoc-discuss" group.
> =C2=A0 To unsubscribe from this group and stop receiving emails fr= om it, send
> =C2=A0 an email to [6]pandoc-discus...@googlegroups.com.
> =C2=A0 To post to this group, send email to
> =C2=A0 [7]pandoc-...@googlegroups.com.
> =C2=A0 To view this discussion on the web visit
> =C2=A0 [8]http= s://groups.google.com/d/msgid/pandoc-discuss/b5fcdda1-aac1-4390-<= /a>
> =C2=A0 84ee-18d745e7a06c%
40googlegroups.com.
> =C2=A0 For more options, visit [9]https:= //groups.google.com/d/optout.
>
>References
>
> =C2=A0 1. javascript:/
> =C2=A0 2. javascript:/
> =C2=A0 3. javascript:/
> =C2=A0 4. https://groups.google.com/d/msgid/pandoc-discus= s/5f012215-b6af-4fa3-b8a7-e8ba2b51ac9b@googlegroups.com
> =C2=A0 5. https://groups.google.com/d/optout
> =C2=A0 6. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> =C2=A0 7. mailto:pandoc-...@googlegroups.com
> =C2=A0 8. = https://groups.google.com/d/msgid/pandoc-discuss/b5fcdda1-aac1-43= 90-84ee-18d745e7a06c@googlegroups.com?utm_medium=3Demail&utm_= source=3Dfooter
> =C2=A0 9. https://groups.google.com/d/optout

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/6f4ab6c8-8a5d-4ebc-99c0-f6c55bbcb024%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_584_286878029.1460156039294-- ------=_Part_583_824962280.1460156039294--