From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14739 Path: news.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Can I eliminate newlines between elements in generated HTML? Date: Fri, 8 Apr 2016 14:53:35 -0700 Message-ID: <20160408215335.GA61469@MacBook-Air-2.local> References: <5f012215-b6af-4fa3-b8a7-e8ba2b51ac9b@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed X-Trace: ger.gmane.org 1460152433 10362 80.91.229.3 (8 Apr 2016 21:53:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 21:53:53 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB3GQUC4AKGQEWEZPJXI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Apr 08 23:53:53 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ig0-f190.google.com ([209.85.213.190]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aoeLd-0004m8-FS for gtp-pandoc-discuss@m.gmane.org; Fri, 08 Apr 2016 23:53:49 +0200 Original-Received: by mail-ig0-f190.google.com with SMTP id nt3sf5238074igb.0 for ; Fri, 08 Apr 2016 14:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=o1YXaJEcjab1SWeE7PqS+Lvy2MSwUfVH/wAHEHZq0Fg=; b=YG3bFaz8IXmG0wNDdSDgrHMnvhuhMX1gAOqoV+SxiU5q2azOZ5K5pHbpwCqiGxsSAE 2hgbtFaSWxEVfJ/r48gm69yW6DL6ztunGkXnQCp0a7dlMDQbCux9/RWf1xVgefpXjcbI EdaeRdb+Lef4JFFIX5jVtXzyBcOAuAl5Bj2SwU8BFMvRVtcBQ2N/lAzvU0EbWXOjEwUf u5rNPpkogPYlSdHXcD0FEQb8W7MK0gB8IQ/S7EnhA2QhDCDxQRfHxTSy+mzm2UPpRc+S 7BPdEJ6V0yA1/D20nRgy4BaXS63o+aBJzevrFQSZEuFbyJ/9E1yN10HrbdxCZSQlmfTH PsDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=o1YXaJEcjab1SWeE7PqS+Lvy2MSwUfVH/wAHEHZq0Fg=; b=T3aZyxTd2ymwR1ZZm1xCBYAshhT21SVF/qH4EJDfwqqfREe1ndtynLlpdsytYQFyUp xZsRgEriDKb7KhZqb+3tBji68OQo+vyB0w57CDRLU8y4marcIUQcKIq4SNWu1zEzDbQi AA8IXfiVmJE8VCLXL6hXx7Lpafurjbl8c0jmfllMHNF9bq2tOmtRg79QQv4QwbYWn5E6 a0CyP2BYwq6Wql/+Bkqgv5FN5uDavuDXPPCbeqnIVZ/gh4k4lSNU6F0MNZdZx4a5DDc4 +8LpC/vmBHrrBgtqCPtCQSpRcrxJ/OYYRGUhecm7rUy1u4cXT36RYaGFyGRKdeDFyGSP Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AD7BkJLcg6npczcbQrERZsQ82pUBHD3jop9EoMIh0ugFbTWHM4BTAidoEC/TSEQqoHI5Hg== X-Received: by 10.182.153.231 with SMTP id vj7mr133666obb.17.1460152428553; Fri, 08 Apr 2016 14:53:48 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.182.76.201 with SMTP id m9ls544405obw.95.gmail; Fri, 08 Apr 2016 14:53:47 -0700 (PDT) X-Received: by 10.157.27.195 with SMTP id v3mr7141019otv.38.1460152427836; Fri, 08 Apr 2016 14:53:47 -0700 (PDT) Original-Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com. [2607:f8b0:400e:c03::22c]) by gmr-mx.google.com with ESMTPS id yr8si339662pac.0.2016.04.08.14.53.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 14:53:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c03::22c as permitted sender) client-ip=2607:f8b0:400e:c03::22c; Original-Received: by mail-pa0-x22c.google.com with SMTP id td3so81699203pab.2 for ; Fri, 08 Apr 2016 14:53:47 -0700 (PDT) X-Received: by 10.66.55.39 with SMTP id o7mr15443465pap.13.1460152427611; Fri, 08 Apr 2016 14:53:47 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id tc8sm20806874pac.29.2016.04.08.14.53.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 14:53:46 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 710D9A5B3; Fri, 8 Apr 2016 17:53:35 -0400 (EDT) Content-Disposition: inline In-Reply-To: X-PGP-Key: http://johnmacfarlane.net/jgm.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c03::22c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:14739 Archived-At: 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to > [7]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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-discuss-/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