public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: jian he <jian.universality-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: transform txt file to html. newline<br> with newline
Date: Sat, 6 Aug 2022 14:28:31 +0530	[thread overview]
Message-ID: <CACJufxGrT-Rjx=b+2e2p_f30Vo_FN1Aby8PuJrWA0hoibpD-xQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]

Hi there. Trying to use pandoc convert txt file to html file. Encountered
some issues with newline.

using postgresql query:

> copy (select '
> <pre>
> <tt>#include &lt;math.h&gt;
> <br>
> double
> norm1(const double v[], const int n)
> {
> int i;
> double n1_v; /* 1-norm of v */
> <br>
> n1_v = 0;
> for (i=0; i&lt;n; i++) {
> n1_v += fabs (v[i]);
> }
> <br>
> return n1_v;
> }
> </tt>
> </pre>')
> to '/home/jian/Desktop/test2.txt';
>

 convert to one record one line test2.txt
Then I do

pandoc -s /home/jian/Desktop/test2.txt -o test2.html
test2.html render

>
> \n#include <math.h>\n
> \ndouble\nnorm1(const double v[], const int n)\n{\n int i;\n double n1_v;
> /* 1-norm of v */\n
> \n n1_v = 0;\n for (i=0; i<n; i++) {\n n1_v += fabs (v[i]);\n }\n
> \n return n1_v;\n}\n\n
>

Is possible to test2.html render the following result.

>     #include <math.h>
>
>
>     double
>     norm1(const double v[], const int n)
>     {
>         int     i;
>         double  n1_v;  /* 1-norm of v */
>
>
>         n1_v = 0;
>         for (i=0; i<n; i++) {
>             n1_v += fabs (v[i]);
>         }
>
>
>         return n1_v;
>     }
>
>
> However If I save the string to an txt file (test3.txt) then I do

pandoc -s /home/jian/Desktop/test3.txt -o test3.html
>
will work as intended.
-- 
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian

-- 
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/CACJufxGrT-Rjx%3Db%2B2e2p_f30Vo_FN1Aby8PuJrWA0hoibpD-xQ%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 4658 bytes --]

                 reply	other threads:[~2022-08-06  8:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACJufxGrT-Rjx=b+2e2p_f30Vo_FN1Aby8PuJrWA0hoibpD-xQ@mail.gmail.com' \
    --to=jian.universality-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).