Re: Other formats in pset like markdown, rst, mediawiki

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Jan Michálek <godzilalalala(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Other formats in pset like markdown, rst, mediawiki
Date: 2017-04-18 10:06:19
Message-ID: alpine.DEB.2.20.1704181744450.13380@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Jan,

>> It seems that the patch does not apply anymore on head due to changes in
>> psql non regression tests. Could you rebase?
>
> This should work on current master (all test passed).

Patch applies, compiles and make check is ok.

There are different flavour of markdown, maybe you should document which
one is targetted. Should it be CommonMark? Another variant? Why?

ISTM that the md format lacks escaping for special md characters:

fabien=# SELECT E'\\n\n</br>' AS foo;
│ foo │
|--------------|
│ \n</br></br>

I'd say that you need to do escaping more or less similar to html?

Also, it seems that you use distinct vertical bar characters in the
format? Or is this a trick of my terminal?? It seems that your patch
introduces U+2502 (BOX DRAWINGS LIGHT VERTICAL) instead of the usual pipe
in some places. Maybe you copy-pasted things from the unicode linestyle.

Why are *_newline variants added for length and formatting? Would it be
possible to do without, say by relying on the line count computed by the
standard function for instance?

The help line is too long, I would suggest not to add the new formats,
the list is already truncated with "..." for other formats.

In the sgml documentation, you introduce tab characters, where only spaces
should be used.

pg_markdown contains a spurious space between a comma and a newline.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-04-18 10:08:25 Re: Proposal: Local indexes for partitioned table
Previous Message Simon Riggs 2017-04-18 10:05:50 Re: PANIC in pg_commit_ts slru after crashes