Re: Remove unnecessary empty lines in article body. New feature?
Dennis Preiser <[email protected]> Fri, 3 Oct 2008 13:31:24 +0200
| Newsgroups | gmane.network.tin.devel |
|---|---|
| Message-ID | <[email protected]> |
On 03.10.2008, at 03:17, Martin Klaiber wrote:
> I usually don't have problems with multiple blank lines, but with
> missing blank lines between quoted paragraphs. Example:
>
>>>> sdl ksdl kjsdk ljsd fklj
>>>> slsdff sdfl jsdflkj
>>> slksd flkjs dflkjsdf
>>>> sdlfjk sdlfkj
>>> sdf lkj slkd jflkj sdf
>>> alkj lkja sadfklj
>> slsklsdfolijsdfk
>
> Instead of:
>
>>>> sdl ksdl kjsdk ljsd fklj
>>>> slsdff sdfl jsdflkj
>
>>> slksd flkjs dflkjsdf
>
>>>> sdlfjk sdlfkj
>
>>> sdf lkj slkd jflkj sdf
>>> alkj lkja sadfklj
>
>> slsklsdfolijsdfk
It is possible to detect the change from one quote-level to another
and insert a empty line in-between. However, your example from below
would become:
>>> sdlkfj sldkjf lksjd lkjsd fsdkjf
>>>
>>>
>>>
>> sdlkj sdlkj sdfklj sdflkj
which is (in my mind) not a improvement. It is necessary to detect
quoted blank lines to get better results (see my annotation below).
> So, if you add your feature, I would be pleased if you extend it
> by an option to add such a blank line between quoted paragraphs.
In my mind it is not a good idea to mix 'remove lines' and 'insert
lines' within one option. If it is agreed to implement this feature,
I would suggest to make it a separate option.
> But I agree with Urs that it might be too much work if you really
> want to do it good. Many newsclients or editors quote blank lines,
> so you get multiple blank but quoted lines like:
>
>>>> sdlkfj sldkjf lksjd lkjsd fsdkjf
>>>>
>>>>
>>>>
>>> sdlkj sdlkj sdfklj sdflkj
>
> I don't know if your patch already considers such cases. Especially
> with nonstandard quote-marks like ':' or '|' a good solution might
> become tricky.
Currently, quoted lines are not touched. More precisely, only lines
containing exactly one character ('\n') are treated as empty.
I think it is not possible to detect quoted blank lines, because the
user can change the quote_regex. For instance, the quote_regex could
match a string from the beginning of a line until the end (^
[sophisticated_stuff]$).
> A simple solution might be, to declare a line as blank which does
> not contain at least a letter or a number. But then lines with just
> a smiley might be deleted (line 4):
That does not work, because some Newsreader use abbreviated names as
quotation marks like this:
MK>
MK> lorem ipsum
MK>
> To come to an end, I would say: your feature sounds nice. But the
> code has to be elaborated so it does not delete lines erroneously
> and this could be a lot of work.
As I said before, lines with 'content' are not touched.
If there is a way to detect quoted empty lines the feature you
suggested would be useful, alas I don't see a way to detect those
lines till now.
Dennis