taskSavane - Tasks: task #2874, Formatting Mechanism

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #2874: Formatting Mechanism

Submitted by:  Mathieu Roy <yeupou>
Submitted on:  Thu 02 Feb 2006 10:54:20 AM UTC  
 
Should Start On: Wed 01 Feb 2006 11:00:00 PM UTCShould be Finished on: Fri 01 Dec 2006 11:00:00 PM UTC
Category: Web FrontendStatus: Done
Priority: 3 - NormalPlanned Release: 1.5
Assigned to: Tobias Quathamer <toddy>Open/Closed: Closed
Privacy: PublicFor/By: None

(Jump to the original submission Jump to the original submission)

Tue 31 Oct 2006 09:14:30 AM UTC, comment #59:

For me it works. Feel free to test the branch and report bugs, mentioning the branch as affected release.

Mathieu Roy <yeupou>
Project Administrator
Thu 23 Feb 2006 05:40:48 PM UTC, comment #58:

> The ability to edit an already posted message raised lot of
> issues and I personally think we should avoid it. It does not
> ease discussion when there is no way to be 100% sure of who
> said what. :)


I absolutely agree here. That brainstorm has been a bit too much, I guess.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Thu 23 Feb 2006 05:32:00 PM UTC, comment #57:

A preview would probably be a good idea (but I think we should keep that for a later release).

The ability to edit an already posted message raised lot of issues and I personally think we should avoid it. It does not ease discussion when there is no way to be 100% sure of who said what. :)

Mathieu Roy <yeupou>
Project Administrator
Thu 23 Feb 2006 05:23:22 PM UTC, comment #56:

> Could we make sure that "----" is interpreted only if
> surrounded by blank lines? Is that doable?


Hm, I don't know if this is possible with the current code or if the function would need to be modified. I can take a look, though.

However, this brings up a new interesting point to the discussion: The markup function is intended to provide a nice formatting of texts, while at the same time it must not destroy any content that (accidentally) matches our formatting rules, see your example above.

This is quite difficult to solve, because I would expect four minus signs "----" on a single line of their own to always display as a horizontal ruler.

Obviously, you expect this not to happen, if the previous line contains text (because you see it as some kind of underlining).

No matter how we decide now and code the markup function, one of us would be quite surprised by the markup result. ;-)

So my idea to solve this would be to add a "preview" function that enables users to see what their comment/news/whatever would actually look like after going through our markup function. If needed, they could correct things with the tags.

We could go even further and allow users to change their comments afterwards, if no more comments have since been posted ... but that's maybe overkill, I don't know (I'm just brainstorming currently).

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Wed 22 Feb 2006 02:23:36 PM UTC, comment #55:

(test please ignore)

Mathieu Roy <yeupou>
Project Administrator
Wed 22 Feb 2006 02:10:00 PM UTC, comment #54:

Hello,

I've realized that I frequently use -- to underline things.

Example from savane code:

Type:
-----
".$type."

Could we make sure that


is interpreted only if surrounded by blank lines? Is that doable?

Mathieu Roy <yeupou>
Project Administrator
Wed 22 Feb 2006 02:06:41 PM UTC, comment #53:

I'd like to start testing this great formatting stuff on gna, but bug #5346, bug #5347, bug #5348 and task #2878 are blocker for me on that regard. I could start try to fix them but you probably have a clearer view on how to do these things.

Mathieu Roy <yeupou>
Project Administrator
Sun 19 Feb 2006 03:51:59 PM UTC, comment #52:

Seems working nicely, there remains only issues about the way it is called in the code (see new deps, I'd rather open an item per issue than posting tons of comments on this item)

Mathieu Roy <yeupou>
Project Administrator
Sun 19 Feb 2006 11:27:26 AM UTC, comment #51:

> It is maybe due to the fact that you called
> utils_basic_markup() (basic), but now all the line breaks are
> gone.


Well, the basic markup doesn't care about paragraph formatting, so it doesn't add any line breaks or paragraph breaks.

Where did you discover this problem? I thought that most uses of utils_make_links() should not add line breaks.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sat 18 Feb 2006 04:11:52 PM UTC, comment #50:

It is maybe due to the fact that you called utils_basic_markup()
(basic), but now all the line breaks are gone.

Mathieu Roy <yeupou>
Project Administrator
Fri 17 Feb 2006 11:10:30 PM UTC, comment #49:

So, the function utils_make_links() is gone now and has been integrated into utils_basic_markup().

I've replaced every call to utils_make_links with the appropriate call to one of the markup functions. This should also resolve bug #5300 and bug #5301.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Thu 16 Feb 2006 06:06:36 PM UTC, comment #48:

I think it makes sense to refactor the markup function as well as the utils_make_links function.

I would remove the calls to the utils_make_links function and integrate the code into a special markup function, which fulfills the specifications of the "basic" markup, i.e. links, strong, and emphasized text. This means in particular that this special markup function will not return the text within <p> tags.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Wed 15 Feb 2006 10:15:53 PM UTC, comment #47:

It is very funny, because "basic" was the first thing that came to my mind but the idea of "rich" made me change it :)

So let's go for full/rich/basic (I admit that "poor" may seem pejorative)

Mathieu Roy <yeupou>
Project Administrator
Wed 15 Feb 2006 06:23:42 PM UTC, comment #46:

Yes, I had some difficulties in choosing names for the context, too -- that's why I just chose the most likely context.

I like your proposal with "full, rich, s/poor/basic/", though.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Wed 15 Feb 2006 06:17:05 PM UTC, comment #45:

Note that I do not think that "poor" should allow verbatim and maybe even not nomarkup.

We want to allows users to specify verbatim where they are supposedly to rightfully post code and things like that -- definitely not in CC comments.

And nomarkup should be for us, for site admins that upgrade an installation and wants to avoid some issues with old items that would cause trouble with the formatting mechanism.

Mathieu Roy <yeupou>
Project Administrator
Wed 15 Feb 2006 06:14:33 PM UTC, comment #44:

"news" is not a good name. We want it for news, but also for recipes and project description and tracker item submission preamble (wherever we want to allow complex html).

"short comment" is also a bit long :(

How about, for the formatting level argument :
- full (headers + hr + lists + bold/italic + links)
- rich (hr + lists + bold/italic + links)
- poor (bold/italic + links)

(I had a hard time to find names that actually means something :) unconfusing between the last two)

Or maybe using 0,1,2 would save us the time to find names (but indeed it is less developer friendly in the long run)

I guess that by default it should go for the more restricted (more cases and more secure to be more strict by default and too relax when necessary than the contrary).

Mathieu Roy <yeupou>
Project Administrator
Wed 15 Feb 2006 05:59:11 PM UTC, comment #43:

I've just reverted the hack to enable utils_wiki_markup() from utils_make_links().

The effect is now that utils_wiki_markup() gets called for the details of an item, but nowhere else. In the long term, all calls to utils_make_links will be replaced with utils_wiki_markup (well, at least where appropriate).

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Wed 15 Feb 2006 05:51:18 PM UTC, comment #42:

Ok, I'm currently changing utils_wiki_markup() to accept a second parameter. With that parameter, you can specify in which context you currently are (e.g. news, comment, short comment) and the markup function would behave accordingly.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Wed 15 Feb 2006 11:11:04 AM UTC, comment #41:

> without needing to change ~200 lines which call utils_make_links. As you quite
> rightly pointed out, not every call to utils_make_links can unconditionally be
> replaced by utils_wiki_markup, that's where this bug comes from.

Would it be easier to have only one function used everywhere?

I think it would be acceptable to have bold in a comment of an attached file.

The issue is about restricting formatting.

On original news items and project description, we want everything (headers and hr)

On items comments and original submission, we want everything but headers (I think hr is fine for comments)

On shorts comments like CC comments or attached files comments, we only want the most basic things.

I do not thing any <p></p> should be added on a simple string. Why would it be so? Is it necessary?

Mathieu Roy <yeupou>
Project Administrator
Wed 15 Feb 2006 11:07:40 AM UTC, comment #40:

Ok,

To make further tests, we should:
- have the code to be simili-production ready (meaning having utils_wiki_markup() called whenever appropriate instead of utils_make_links() -- probably in most places utils_make_links was called).
- have the upgrade script available

Then I would be able to put it live on Gna!

Mathieu Roy <yeupou>
Project Administrator
Tue 14 Feb 2006 10:23:53 AM UTC, comment #39:

> (utils_make_links is used in many places for simple strings,
> that cannot be surrounded by <p>)


Alright, that's a bug. However, please note that the current formatting is kind of hackish, it just does the markup from within utils_make_links, that's why the <p> tags are added.

In the release version, we would call utils_wiki_markup where appropriate (i.e. replace the call to utils_make_links), and that function in turn should call utils_make_links, not the other way round. This will enable us to have the links converted where needed, without additional formatting applied, by calling utils_make_links directly.

I've applied this hack so that we're able to see the effect of markup working, without needing to change ~200 lines which call utils_make_links. As you quite rightly pointed out, not every call to utils_make_links can unconditionally be replaced by utils_wiki_markup, that's where this bug comes from.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Tue 14 Feb 2006 10:09:58 AM UTC, comment #38:

There's a bug somewhere, on CC list comment (which is passed to utils_make_links), there are <p> and </p> added around the comment.

See attached screenshot.

I think this is due to the wiki markup that someone make a mistake.

(utils_make_links is used in many places for simple strings, that cannot be surrounded by <p>)

Mathieu Roy <yeupou>
Project Administrator
Mon 13 Feb 2006 10:25:34 PM UTC, comment #37:
Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 12 Feb 2006 06:07:18 PM UTC, comment #36:

> Maybe we could have "-" as alias of "*" (or maybe it is a bad
> idea because "-" is widely use for many purpose, I don't know)


Well, I think we're on the safe side if we allow only one formatting, without aliases. It minimizes possible wrong positives.

> Hum, wouldn't it be simpler to use
> = adad = to === adad ===


Maybe. I thought that === heading === was easier to distinguish than = heading =, but we surely can change that, no big deal.

> Hum, I would be over-cool if quoted content [...] was in a
> different color (lighter), as it is often in nowadays email
> clients.


That's funny, I was just thinking the same ... so I'll give it a try. ;-)

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 12 Feb 2006 05:53:58 PM UTC, comment #35:

Hum, I would be over-cool if quoted content like

> I quote the previous message
> bla bla


was in a different color (lighter), as it is often in nowadays email clients.

That should not cost much, and we do not need overcomplicated things (for instance color change different if it is > or >> or >>> etc), just a basic color change.

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 05:52:15 PM UTC, comment #34:

> keep '*' for unnumbered lists, though. How about using '0' as the start of a
> numbered list, like this:


Why not.
The idea with "-" was that it's very natural for many people to use "-" for unnumbered list, but "*" is okey too.

Maybe we could have "-" as alias of "*" (or maybe it is a bad idea because "-" is widely use for many purpose, I don't know)

> That's correct, we support headers from level 3-6, i.e. with three to six
> equal signs on each side.


Hum, wouldn't it be simpler to use
= adad = to === adad ===

Users ignore that will use from h3 to h6, what they know is that they have 3 level of headers.
Users don't (should not) care about the HTML behind the scenes. :P

======= is getting complicated ====== :)

> verbatim has just changed its name to and , so it does

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 05:44:40 PM UTC, comment #33:

About the numbered lists: you're right, we should switch that. I'd like to keep '*' for unnumbered lists, though. How about using '0' as the start of a numbered list, like this:

  1. list item
    1. nested list
  2. next item

> I know Tobias that the wiki syntax in proposed in my original
> message was not doing it that way, but I guess it's time for
> fine tuning isn't it :)


Sure, that's what testing is about ... :)

> = adad = doesn't work on my test install


That's correct, we support headers from level 3-6, i.e. with three to six equal signs on each side.

> verbatim seems still incomplete regarding fonts but it
> properly disactivate the markup.


and
Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 12 Feb 2006 05:29:58 PM UTC, comment #32:

Ok, I've just noticed that using

# a
# ad

to produce numbered list is a no-go: each time someone will post a text with comments without using nomarkup/verbatim, he'll get such list...

Also, many people do unnumbering list like this :
-
-
-
-

Maybe we should use
-
-
-

for unnumbered

and
*
*
*

for numbered list.

I know Tobias that the wiki syntax in proposed in my original message was not doing it that way, but I guess it's time for fine tuning isn't it :)

-------

= adad = doesn't work on my test install

-------

verbatim seems still incomplete regarding fonts but it properly disactivate the markup.

-------

I don't exactly get the point of "Hyperlinks: http://gna.org/" as hyperlinks are already made as links by utils_make_links()

Link does not work on my test install

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 05:27:11 PM UTC, comment #31:

> About the tag styles, sorry to be picky :P, while I like
> #verbatim#, I dislike #/verbatim# (seems weird).
>
> How about
>


Hm, I think I like that best. It's now implemented, and I've changes its name to and .

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 12 Feb 2006 05:20:31 PM UTC, comment #30:

We have no hurry to release, we'll wait necessary time to provide it well polished.

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 04:56:30 PM UTC, comment #29:

Mathieu, the wiki markup hasn't been activated yet. I just committed a fix for this, although the fix needs to undergo some more thoughts. Currently it's a quick and dirty hack. It must be solved properly before the release.

However, the wiki markup should work now ... could you test your installation of the branch again?

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 12 Feb 2006 03:56:46 PM UTC, comment #28:

(About comment #26: actually, I would not expect = aada = to have any effect in a comment)

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 03:55:51 PM UTC, comment #27:

About tags:
----------------

About the tag styles, sorry to be picky :P, while I like #verbatim#, I dislike #/verbatim# (seems weird).

How about




...

or

#+verbatim#

#-verbatim#

#+nomarkup#

#-nomarkup#

About markup behavior:
-------------------------------

The reason I'd like verbatim to print things as they are is the idea that people that will use this will want it to really do it's best to print things as they were "verbatim". And fixed-fonts and all just make this possible.

On the other hand, it may be useful as well to have the nomarkup, just in case the only thing that matter is to get unaltered characters but while the output style does not matter.

Finally, I don't want to go for <code> and all that tags widely used so far, first because they refer to things known only... by people that already knows (popularity does not mean being popular to an elite), second, the point is to avoid to alter content by mistakes, and to avoid that the best is to avoid XML/HTML like tags that are expected to use by people not especially aware that using them alter their content.

As I already said I think, I would not like having someone copying/paste a bit of HTML "aacc <code>ada</code>adad" to have it's content altered just because he did not knew that Savane would convert "<code>".
With alternative tags that are not referring to a know markup language like HTML, I guess we drastically reduces the odds that it happens.

Mathieu Roy <yeupou>
Project Administrator
Sun 12 Feb 2006 03:32:07 PM UTC, comment #26:

On my test install running the branch, I typed:

aadadd

a

= adad a=

adaodd a _adadad_a adad * adadad adada*

adadad

in a support request and it was showed with no formatting.

Then I tried to post the same as comment and the same result occured.

Mathieu Roy <yeupou>
Project Administrator
Sat 11 Feb 2006 02:05:35 PM UTC, comment #25:

I still think there should be something like <code> HTML tag. Tags like <font>, <b> etc. are deprecated in HTML because they are purely presentational and carry no semantic meaning, unlike <code>.

You could also have <pre> analogue like in MediaWiki: if a line starts with a space, whitespace is honored in it. This is quite convenient, but on the downside, can be pretty surprising to an unaware user.

Paul Pogonyshev <doublep>
Project Member
Sat 11 Feb 2006 08:55:07 AM UTC, comment #24:

Currently, I've implemented #verbatim# to simply disable the wiki markup formatting, without changing anything else.

In my opinion, if we want to have the whitespace treated as being significant, we need something like the <pre> tag in HTML.

Mathieu would like the #verbatim# tag to respect whitespace, so we're currently discussing how to solve this best. My last proposal has been to change the meaning of #verbatim# to behave exactly as Mathieu wants, and adding a new tag which does only disable the markup (thus replacing the current #verbatim# tag).

Here is an example (Note that I've changed the space character to the underscore, otherwise noone would notice the difference in the HTML browser):

#verbatim#
Two spaces at the beginning of a line
#/verbatim#

... will result in this HTML output:

<pre>
Two spaces at the beginning of a line
</pre>

(Starts a new block with <pre>, switches the font to monospace, respects whitespace, disables the wiki markup)

On the other hand, this example here:

#nomarkup#
Two spaces at the beginning of a line
#/nomarkup#

... will result in this HTML output:

Two spaces at the beginning of a line

(Just disables the wiki markup. No changes to the font family, whitespace will be in the HTML source, but not displayed in the browser, no new block gets started, but the output is appended to the current block, which may be a paragraph, list, etc.)

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Fri 10 Feb 2006 11:26:47 PM UTC, comment #23:

Does #verbatim# tag imply fixed-width font? If it does, then it makes escaping unintended markup clumsy, else there is a need for code-introduction tag.

In either case, I propose #code# or some similar tag. It should turn on fixed-width font and be translated to <code> HTML tag, which carries semantical meaning. Whether or not it should imply #verbatim#, I'm not sure. Implying is convenient, but orthogonal tags give greater flexibility...

Paul Pogonyshev <doublep>
Project Member
Thu 09 Feb 2006 05:50:40 PM UTC, comment #22:

Alright, please test this function on real data. Currently, the following markup is supported:

=== headings (level 3-6) ===

Simple paragraphs, separated by an empty line like this

---- (horizontal rulers)

Inline markup: strong and em

Hyperlinks: http://gna.org/ and named links: The name, even with markup

  • Bullet lists
    • with deeper levels

# Numbered lists,
## also with
### deeper levels

  • Mixed

## lists

You can disable the markup with #verbatim# tags #/verbatim#

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Mon 06 Feb 2006 04:12:46 PM UTC, comment #21:

> I cannot attach a 50 MB file to this task.


Mathieu, I was only kidding, of course. It doesn't make sense to store a complete database dump in the very same database ...

I also don't need administrative data like users or passwords. Could you just send a dump of e.g. the bugs table to me -- or better, upload it somewhere so I can download it?

With regard to the headings, you're right. We should support them from level 3 on.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 10:46:19 PM UTC, comment #20:

Looking at task #2881, especially to the line "######### REGISTRATION ADMINISTRATION #########" it crossed my mind that actually we definitely not want to allow h1 and h2

Only h3, h4 and h5 will not endanger our usual layout. Allowing h1 and h2 would be messy I think.

(indeed in comments, no header should be allowed anyway, but that's for details, news items, project description and users resume.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 10:33:38 PM UTC, comment #19:

I cannot attach a 50 MB file to this task.

I cannot dump everything as I get it would be unwise to put somewhere outside of the backups servers dump including passwords (ok they are md5ized but...).

I'll make a dump of only items, if that's fine.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 09:59:14 PM UTC, comment #18:

> As said, I have real issues with quotes.

[Much more issues deleted]

Alright, I give in, you're probably right. :)

To settle this discussion, I'd like to use strong and em. I wouldn't like to use the double characters, because nobody uses that in non-HTML mails, everybody only uses the single characters.

And as I said, the test cases all work correctly with this setup currently. However, I'd like to do some tests with real data, so it would be great if you could make a dump of the Savane DB available to me.

You could just attach the file to this task ;-)

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 09:45:22 PM UTC, comment #17:

As said, I have real issues with quotes. These are the cause of probably half of the bugs I encountered during savane development, mostly due to escaping things. I'd really love to avoid these nasty things.
Also, somehow it hurts me to get quotes for a usage that is note quotation :(
Finally, I'm definitely sure this will lead to major headaches regarding possible false positive, as in the code, quotes are quite common. '' is so alike " that is is really an open door to problems.

No?

While wikipedia is definitely a very nice piece of collaborative work, their choice regarding technical things may not be so wise to be followed. I gave a tried to mediawiki for my local webserver at home. I use a wiki to work. It was damn slow for nothing, nothing by comparison to Kwiki, I had to drop it only a few minutes after installing it. It's never a good sign when a piece of software is litterally unusable while you havent started using it at all, when it is not really doing anything.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 09:36:01 PM UTC, comment #16:

> adad and adada are way more common, have an history from
> the days when no mail client was handling html.


Hm, that's a fair point.

Given that we're currently supporting that (well, apart from em, but that doesn't seem to be too difficult), we should just let this syntax be valid markup.

But to serve the principle of least surprise, we could additionally allow '''strong''' and ''em'' markup for those wikipedians out there.

I think this solution is my personal favourite.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 09:28:20 PM UTC, comment #15:

The big difference is the fact that ''' does not really means anything. You could use ''' to mean whatever you want, it has no real background.

adad and adada are way more common, have an history from the days when no mail client was handling html.

And frankly, it is easy to remember ada = emphasis and aada = bold, while remembering that ''' is bold and not emphasis, and not the contrary, is definitely getting complicated.

Finally, quotes are already used in so many ways and so many places, I guess it is more safe to avoid messing with it. And if we get back to litteracy, quotes definitely means something different than bold for instance.

Doubling signs indeed seems a good way to avoid false positives. But I'm a bit annoyed in fact with the text version output of it that will be in mails. Maybe it will be a bit ugly. Maybe not.
So maybe we could give the non-double version a shot. I don't know.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 09:16:17 PM UTC, comment #14:

I've just read the MediaWiki syntax again. We provide almost identical formatting tags, and I think this is a good approach, considering that those tags are used for the wikipedia, which is as far as I know the biggest wiki installation. Therefore, many people are probably already familiar with that markup.

That brings me to the question if we should change the only markup that's currently different from wikipedia.

We use strong and /em/ markup, but have recently discussed to better double those marking characters, so we would use *strong* and _em_ markup.

I propose to switch to the wikipedia syntax and use '''strong''' and ''em'' instead.

Comments?

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 04:24:44 PM UTC, comment #13:

> I still don't like the idea very much to add some special tags to every DB

> entry. I think it would be a cleaner solution to disable the wiki markup for
> those entries completely, even for future entries. We could then allow the
> markup only for project descriptions and recipes.

No no, in many cases, in comments and elsewhere, it would be truly nice to be able to do some formatting stuff. Indeed, the wiki have to handle 2 levels of formatting: for recipes content, news contents, project description ; for comments and usual items details. In the first level, headers and hr should be allowed, not in the second level.

If we don't go on special tags for every db entry (I admit you are right, it is not an uber-clean way to do things), at least we should double markup signs, *strong*, //em//, _underline_.

And in this case, yes I guess we should provide an update script that would use the wiki formatting regexp to detect whether it would do any conversions in previous items. And if it does, it should ask whether a #verbatim# tag should be added around the incriminated words (not the whole item details or comment) so the admin when upgrading his installation would be 100% sure that after the upgrade there are no uncatched issue, no bits of code altered.
(asking him to do everything by hand in phpmyadmin is a no go even if only 1% of the items are affected. On LCG Savannah, it would mean editing more than 130 items!

On another topic, I've just realized I'm a bit annoyed by the underline idea and the /complexity/. Normally, in a word where you study litteracy, you are supposed to use underline to mean italic when you are writing by hand. Underline is supposed to be only a clone of italic more doable for a human. You frequently use this when you are using foreing langagues words in your text.
So maybe we should not contradict this principle (that definitely ring a bell to me) and use _adada_ for the italic and skip the underline idea.
This will be more logical for a typographical point of view. And it saves us the frequent case of http://mywonderfulurlwitha/andanother/
What do you think?

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 04:24:43 PM UTC, comment #12:

I think it is important to distinguish between disable-wiki-formatting and treat-this-verbatimly tags. E.g. MediaWiki has <nowiki> and <code> tags for these purposes. The first tag is used to overcome false matches, the second carries contextual meaning. It's also much like <pre> and <code> in HTML.

Regarding external links I think it is better to use single brackets and allow only a limited set of protocols, like http, https and probably nothing else. That way double brackets can be reserved for internal links and the syntax is more similar to MediaWiki. Matching is still pretty fail-safe given that you match for `\[(http|https)://...'.

Paul Pogonyshev <doublep>
Project Member
Sun 05 Feb 2006 04:06:50 PM UTC, comment #11:

> Frankly, I do not want to simply do test for this. We wont be
> able to check the 13000 items posted at LCG Savannah and we
> cannot publish a version that may alter inappropriately old
> item. So even if we do test and dont detect problems, we'll
> still have to add tags for the old item so they are not
> affected by the wiki formatting because they were not meant to
> be formatted this way.


Would it be an option to write a script that checks this and reports possible problems? The admin could then fix those before upgrading. I imagine that those errors will be only very few. That's why I'd like to run some tests on the Savane DB. If it turns out that there are many problem cases, we must not perform that markup.

I still don't like the idea very much to add some special tags to every DB entry. I think it would be a cleaner solution to disable the wiki markup for those entries completely, even for future entries. We could then allow the markup only for project descriptions and recipes.

> Why not. But in this case, shouldn't we use double signs
> everywhere for cohesion sake?


Hm, we could do that. However, I like this syntax better than this *syntax*. We could also allow both, since the single markup characters already work ...

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 03:48:36 PM UTC, comment #10:

> The text I'm submitting right now for this task won't be displayed verbatim,

> but filtered through nl2br() instead, so I get my linebreaks like they were
> intended. Also, if I use a reference link to some bug number, it'll be
> converted as well.

Well, if you use the true html verbatim, it will respect your linebreaks even without adding br.

But as I suggested in my previous comment, your message will only have the partial verbatim, that will not use the true html verbatim, and as such will call nl2br().

> Having all texts displayed with a fixed-width font makes reading quite ugly,
> in my opinion.


I was not clear about that, but that will be only for true verbatim, not for the partial verbatim.

And the point of verbatim will be to provide code, patch, whatever that should not be altered. And this should be fixed.

But I agree, apart for that purpose, fixed fonts is a pain in the ass. My web browser is actually configured to use a non-fixed font even as fixed font, because some websites abuse of it.
(But I'd say it's my problem if I wont notice any difference, it is not relevant here, what matter is that Savane will ask for the fixed font for the verbatim case).

> I suggest to try this function with real data from the trackers and see how
> the data will be marked up, so we can discuss how to solve possible problems.


Frankly, I do not want to simply do test for this. We wont be able to check the 13000 items posted at LCG Savannah and we cannot publish a version that may alter inappropriately old item. So even if we do test and dont detect problems, we'll still have to add tags for the old item so they are not affected by the wiki formatting because they were not meant to be formatted this way.

> With regard to the hyperlinks, I like the proposed syntax as well. However, I
> suggest to use double brackets [[link]] instead of single brackets, so it's
> easier to match with a regexp.


Why not. But in this case, shouldn't we use double signs everywhere for cohesion sake?

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 03:38:08 PM UTC, comment #9:

I don't like the idea to display each and every entry ever submitted in verbatim, especially as we're not doing this currently.

The text I'm submitting right now for this task won't be displayed verbatim, but filtered through nl2br() instead, so I get my linebreaks like they were intended. Also, if I use a reference link to some bug number, it'll be converted as well.

The wiki markup function currently does correct markup of paragraphs (i.e. not just <br />, but <p></p>), which will display nicer in the browser. It's also more to the intention of the submitter.

Having all texts displayed with a fixed-width font makes reading quite ugly, in my opinion.

I suggest to try this function with real data from the trackers and see how the data will be marked up, so we can discuss how to solve possible problems.

With regard to the hyperlinks, I like the proposed syntax as well. However, I suggest to use double brackets [[link]] instead of single brackets, so it's easier to match with a regexp.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 03:21:02 PM UTC, comment #8:

Additional note regarding hyperlinks mentioned in comment #4:

We definitely won't support camel case links as we do not need to (well it is not a wiki) but the syntax Title of the link is nice I think. I'm frequently annoyed by the fact that currently Savane does not allow to put a title to hyperlinks.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 02:38:53 PM UTC, comment #7:

Well, the way I see it, we need a tag that means verbatim, which means that the content of a message wont be altered. Links will be added whenever useful (like "tracker #nnnn", or "http://url") but that's all.

And all previous items that are not cookbook items or "project description" (as shown on projects main page) should be altered so their content is considered as verbatim (we just have to put the verbatim things at the end and begin of each comment and details).

We don't have to provide a formatting that is backward compatible with text-only content, we just need to convert HTML whenever it was added as HTML. Everything else must be added verbatim because in the mind of people that submitted it, it was meant to be shown verbatim (and that's how it worked until now).

Do you get my point?

For the verbatim tag, I think we surely need something verbose and unusual, like
#verbatim#
bla bla
bla bla
#verbatim#

And for this, we should also update the css so the content is printed with fixed-font and ideally that it is true verbatim - indentation would be respected.

There's only one issue with that: true verbatim would not allow us to do html for instance for replace "tracker #nnn" with a hyperlink. There's only two options in this regard:
- doing only partial verbatim, keeping things in html allowing us hyperlinks. Backward compatible without effort but break indentation and makes our verbatim mode awkward
- doing true verbatim but having the update script that will add the #verbatim# (whatever the string is, it is just an example) at the begin and the end of items content also adding the same string before and after each links -- I think this is likely to cause plenty of false positives
- doing true verbatim but having also a partialverbatim tag, that would not be advertised but be the one that would be used by the update script, that would simply add #partialverbatim# at the end and begin of each old item content. This would tell to the wiki format function to be behave how savane behave in until now, by altering content to put hyperlinks but not applying wiki format.

The late option is the only sane option, IMHO.

Side note: details and comments content should be in "text-align: justify" as soon as it's not inside #verbatim# or #partial verbatim#.

Mathieu Roy <yeupou>
Project Administrator
Sun 05 Feb 2006 02:15:55 PM UTC, comment #6:

Well, that would be an option, too. However, the code currently works quite good with some test cases, so I hope that there's no need to use double characters.

If we discover a test case that doesn't get rendered correctly with this approach, we might consider to require the double slash (//).

Thanks for this suggestion.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 01:41:45 PM UTC, comment #5:

One more point. Maybe the different emphasize formatting should use doubled characters (e.g. //italic// instead of /italic/) to avoid most false matches?

Paul Pogonyshev <doublep>
Project Member
Sun 05 Feb 2006 11:51:36 AM UTC, comment #4:

Yes, I agree. The camel case style doesn't look good, and I prefer the MediaWiki syntax as well.

However, we're currently not designing a full featured wiki system, so there won't be wiki links at all. The main purpose at this time is to provide some formatting features, like headings, paragraphs, lists, and inline markup like <strong> and <em> tags.

In case we decide later on to provide a real wiki to the users as well, we can certainly use the same code for the formatting, and I will implement nice links then.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sun 05 Feb 2006 12:20:57 AM UTC, comment #3:

Maybe we could use simplified MediaWiki syntax with complicated features stripped off? I personally hate camel case and would appreciate nice links with variable text part like MediaWiki provides. Camel case links are especially awful for languages with reach morphology, like Russian or, perhaps, German, because they make sentences grammatically incorrect even if you ignore the run-together words.

Paul Pogonyshev <doublep>
Project Member
Sat 04 Feb 2006 10:11:19 AM UTC, comment #2:

Yes, absolutely. That was exactly how I was thinking of this function.

Tobias Quathamer <toddy>
Project MemberIn charge of this item.
Sat 04 Feb 2006 10:05:33 AM UTC, comment #1:

Simple comment: I think we should put the wiki format in the database, and do the conversion on the fly only.
It will be easier to extract the data in text (for instance when sending text only notifications.
Indeed, it means that we will have to run utils_wiki_format() on each relevant output, so I guess this function has to use regexp in a very cheap way (using preg_*() etc).
No?

Mathieu Roy <yeupou>
Project Administrator
Thu 02 Feb 2006 10:54:20 AM UTC, original submission:

A formatting mecanism should be provided for cookbook recipes, news items and even comments.

Tobias suggested a wiki style formatting and I think it is a good approach. I like http://kwiki.org/?KwikiFormattingRules except that we do not need to implement tables (a bit overkill).

In comments, headers and separators (hr) should not be accepted, it would break the page layout.

Maybe it should be activated by default and possible to deactivate it. If we do not provide the possibility to deactivate it, we will have to make it very clear that users need to use the "code" tag that will be make the content directly converted to html entities and shown with fixed width fonts (actually I prefer this later option).

This work should be done on branch DEV-2006.02-FORMATTINGTEXT, see task #2873

Mathieu Roy <yeupou>
Project Administrator

 

No files currently attached

 

Digest:
   bug dependencies.

Digest:
   task dependencies.

 

Carbon-Copy List
  • -unavailable- added by doublep (Posted a comment)
  • -unavailable- added by toddy (Updated the item)
  • -unavailable- added by yeupou (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Nov 2006 03:01:58 PM UTCyeupouAttached File#622=>Removed
    Tue 31 Oct 2006 09:14:30 AM UTCyeupouStatusReady For Test=>Done
      Open/Closed-Automatic update due to transitions settings-=>Closed
    Mon 02 Oct 2006 12:30:30 PM UTCyeupouDependencies-=>task #3776 is dependent
    Wed 27 Sep 2006 12:56:30 PM UTCyeupouDependenciesRemoved dependancy from task #3633=>-
    Thu 14 Sep 2006 07:01:32 AM UTCyeupouDependencies-=>task #3633 is dependent
    Tue 05 Sep 2006 12:42:15 PM UTCyeupouShould be Finished onTue 01 Aug 2006 10:00:00 PM UTC=>Fri 01 Dec 2006 11:00:00 PM UTC
    Tue 15 Aug 2006 08:21:31 AM UTCtoddyDependenciesRemoved dependancy from task #2873=>-
    Tue 15 Aug 2006 08:20:58 AM UTCtoddyDependencies-=>task #3530 is dependent
    Sun 19 Feb 2006 03:51:59 PM UTCyeupouDependencies-=>Depends on bugs #5348
      Dependencies-=>Depends on bugs #5347
      Dependencies-=>Depends on bugs #5346
    Tue 14 Feb 2006 10:09:58 AM UTCyeupouAttached File-=>Added problem.png, #622
    Thu 09 Feb 2006 05:50:40 PM UTCtoddyStatusIn Progress=>Ready For Test
    Sat 04 Feb 2006 10:11:19 AM UTCtoddySummaryFormatting Mecanism=>Formatting Mechanism
    Sat 04 Feb 2006 09:43:58 AM UTCyeupouStatusPostponed=>In Progress
      Assigned toNone=>toddy
    Thu 02 Feb 2006 10:55:06 AM UTCyeupouDependencies-=>task #2873 is dependent
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup