プロジェクト

全般

プロフィール

Vote #67881

完了

Quoting, newlines, and nightmares...

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
開始日:
2010/08/16
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
27
issue_org_id:
6148
author_id:
16843
assigned_to_id:
1188
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

h3. Prelude

Apologies in advance if this bug exists already, I searched around but couldn't find anything. I also tried to engineer a patch, but i got lost really fast once things went into RedCloth territory.

h3. Input:

> One Line
> Two Line
> Three Line

h3. Expected:

Something along the lines of:

One Line

Two Line

Three Line

Without the extra line breaks.

h3. Actual:

One Line
Two Line
Three Line

h3. Comments:

Two newlines, back to back, signifies a paragraph. Got it. A single newline, particularly when inputting text then quoting it (like when I am copying in the body of an external email, for instance) should at least put in a line break (@
@) at the end of each line to attempt to retain some of the structure of what was there. I don't need it to be rigid like @pre@ is, but it needs to be somewhat stricter than what it is currently.

Another option may be some kind of redcloth extension / override that lets people put in a line break manually, either via the HTML syntax, some kind of formatting hook, a macro or .


journals

I think it should work out of the box, no need for a specific macro or manual hack.
--------------------------------------------------------------------------------
Nick, don't ask me why exactly that is (there are reasons for that, but somewhat deeper than the time I have now allows), but:

<pre>> blah
foo</pre>

Probably yields what you are looking for:

> blah
foo

I don't know if this is redmine mangling textile's @bq.@ tag or earlier redcloth/textile versions behaving that way, but the correct interpretation of:

<pre>> blah
> foo</pre>

Should be:

<pre><code class="html"><blockquote>
<p>
"blah"<br>
"> foo"
</p>
</blockquote></code></pre>

rather than what we are getting now:

<pre><code class="html"><blockquote>
<p>blah
foo</p>
</blockquote></code></pre>

You can try that "on the textile example page":http://www.textism.com/tools/textile/index.php, though the tag for (block)quotes there is not @> @ but @bq. @.
--------------------------------------------------------------------------------
So there are two problems behind what you say Felix (and what Redcloth implemented maybe) :
# the wysiwyg buttons "quote" and "remove quote" add/remove @>@ signs at the beginning of each line
# when you copy/paste mails, there's a @>@ at the beginning of each line, not just the blockquote. Plus I don't really see how we could have lines quoted multiples times (useful for mails, again) with this syntax

What do you think ?
--------------------------------------------------------------------------------
Well, the single tag that spans until the end of the current paragraph/the next _pair_ of newlines is consistent with the rest of textile, e.g.:

<pre>h2. some title
spanning 2 lines</pre>

yields a title with a @<br>@ in it spanning 2 lines:

h2. some title
spanning 2 lines

or in html:

<pre><code class="html"><h2>
"some title"
<br>
"spanning 2 lines"
</h2></code></pre>

In this respect, the current blockquote implementation breaks the textile idiom.

As to your questions: I'm not sure textile supports nested blockquotes, but that's probably only because of the use of @bq. @ rather than a "specific" tag like @>@. I think it should be possible to get nested blockquotes with @>@ repetition as it is done for lists (@**@ starts a sublist in another @*@), as to mails: yes, there'd need to be some mangling to remove the extraneous @>@ on all lines past the first one, but that's the price to pay to have _textile_ rather than _mail_ syntax in the wiki fields :-)

(on a side-note: you can't start with a double-nested list item in textile, i.e. @** foo@ on its own on a line will still generate a list of depth 1 instead of 2, but I suppose this is more a safe-guard for lists)
--------------------------------------------------------------------------------
Come to think of it, @>@ already does everything we "need" except that it doesn't start a new blockquote when hitting a new @>@ and continues the current blockquote instead.
--------------------------------------------------------------------------------
That's all well and good, for you and I and Jean here to discuss it in the context of a programming condundrum. But I have a dozen new Redmine users looking at it and going "Well that's dumb.", because it is (and i'm certain my users aren't the only ones). Headers make sense that they get a blank line after them. Paragraph tags too. The table syntax, while weird, is still better than MediaWiki's. But the quoting stuff is confusing for reasons passing understanding. I can't tell them to just wrap stuff in @pre@ tags, because then long lines run off the screen and don't wrap, which is confusing as well for somebody not familiar with the problem.

Whether its right or not, in the context of the syntax, its not what people expect. I don't expect being able to paste in random text and have all the formatting preserved, but i DO expect at least the new lines to get preserved, without me having to go massage a giant body of text. @\n\r@ is a @\n\r@, and that is especially true when *quoting*.
--------------------------------------------------------------------------------
Oh, and as Jean pointed out, the Quote/Unquote buttons in Redmine add a > to the beginning of each line, whether or not they should or not, based on your summation of how things work, further confusing users and the situation.
--------------------------------------------------------------------------------
Fixed in r5133. Line breaks are now preserved in quoted text.

> the current blockquote implementation breaks the textile idiom

Maybe, but that's not the issue reported here. A nice thing is that it supports block formatting inside quoting:

> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.
> * Donec odio lorem,
> * sagittis ac,
> * malesuada in,
> * adipiscing eu, dolor.
>
> >Nulla varius pulvinar diam. Proin id arcu id lorem scelerisque condimentum. Proin vehicula turpis vitae lacus.
> >Proin a tellus. Nam vel neque.
> >
> >|test|test|
> >|cell|cell|

I doubt that it can be done with pure textile syntax. Please, let me know if I'm wrong.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョン1.2.0_27 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0