Before you read this post press the hard refresh button on your browser (e.g., CTRL-F5).

Overview

The A.cc HTML mockup (yes, a bad pun on markup) code has been overhauled. Almost everything is different, so you really do need to pay attention to the changes. This is not an attempt to fix any shortcomings in the implementation of the previous version. Instead, the focus was on modernizing the language itself to be less whimsical than the bbcode-ish variety.

For the impatient, refer to the Cheat Sheet. <-- IF YOU ONLY HAVE A FEW MOMENTS TO LIVE, READ THIS

I wrote the thing entirely over the past weekend. As always, I do no advanced testing. Edge cases are particularly prone to doing weird things. If you come across something that isn't displayed properly, then tell me about it. But first make sure it isn't by-design behavior by reading how everything is supposed to work.

If you find ways to inject arbitrary HTML and JavaScript, please tell me privately and give me at least 20 years to fix it before publicly disclosing it. I am not interested in DoS or anything like that. So don't try.

If you have comments, concerns, or questions, then ask (after reading all of the material).

It is not backward compatible; don't ask for it to be.

What's new?

HTML tags replace old [square bracket] tags

Think <b> instead of [b], <quote> instead of [quote], etc. All tags must be well formed XHTML. This means:

All attributes have a name and a value

All attribute values must be quoted with double quotes.

All tags must be closed, and in the proper sequence.

The following are errors:

<foo bar> - bar has no value.

<foo bar=1> - bar's value is not quoted.

<foo><bar></foo></bar> - foo is closed before <bar>

<img src="foo.png"> - The tag is not closed. It can be closed with a trailing slash: <img src="foo.png" />

Unlike real XHTML, all errors are ignored. This allows you to not have to worry about escaping XHTML characters. e.g., you can safely enter fake tags like <grin> or invalid sequence like <a-b>.

There are limitations on what tags can hold. It should be obvious, but things like <a><quote> are not allowed. The invalid inner tags will just be printed out as-is.

The escape character: \

In some situations, you may want to disable transformations from taking place. To do that, you can prefix them with a \ character. The escape sequence only goes into effect if the next character can be escaped. So both a single \ and double \\ will show up just fine, as there's nothing to escape. It's meant for something like \<b> to be displayed as <b>.

Again, the goal is for it to just work. If you find yourself wanting to escape a character, it will probably work. If not, it will probably show up as-is.

One exception is that smileys cannot be escaped. However, they now must be preceded by whitespace. Thus Foo::Par doesn't trigger a smiley, nor does a bewildered question???

Automatic spacing

Paragraphs and new lines automatically inserted. A technicality: <p> tags are now generated in place of double <br /> tags.

Note that most inline tags do not support spacing. This is by design! If you try to put line breaks inside (e.g.) <b> tags, nothing will happen (other than a single whitespace character).

Headers

The <h1> ... <h5> tags are now implemented. Handle with care!

Very few posts need them. Unless you are composing a very complex document with logical sub-sections, do not use them.

And when you do use them, don't feel compelled to start out with <h1> or <h2>. They both add horizontal lines which may be distracting in a small post. <h3> is more appropriate to divide a medium sized post up into a few sections.

Pre-formatted text

The <pre> tag now works exactly like it does in regular HTML. All inline tags that do not change the size of the font can be used inside it.

There is a new <terminal> tag that can be used to display output from a terminal, compiler, etc. It will likely replace most usage of <pre>. It scrolls like a <code> box, but does not get colored.

References

Spoilers

"Spoiler" text can be hidden via the <spoiler> tag. The contents will be hidden until you click the "reveal" link.

Embedded objects

Multimedia can be embedded via the <object> tag. By default, embedded content will be an image. Clicking on the image will create the embedded object's widget.

You can adjust the default behavior in one of two ways (not implemented yet):

More Strict: Embedded objects are always displayed as text links, or

Less Strict: Embedded objects are automatically activated. (Not to be confused with automatically playing.)

Embedding an image is the same thing as using the <img> tag, so none of the above applies to them.

Currently, not much is actually implemented other than an mp3 player. But the idea is that it could support any type of embedded content.

Inline images

There are a few subtle changes to the images:

Clicking on thumbnails will not ever display any image larger than 1024 pixels. I'm tired of people uploading five billion megapixel images showing off grains and blurs. To display the super-full sized image, you will have to shift-click on it.

If a thumbnail is also a link, you can activate the link via ctrl-clicking on the image. Those thumbnails will have blue borders. (But I still don't recommend putting images inside links.)

Images from attachments are no longer cached! If you upload an attachment, link to it, and then delete it, the original full size image will be gone.

Also, strictly to save disk space, images are no longer double cached. Displaying the same image from multiple sources will result in a single cached instance.

Inline images (e.g., BMP) that are not web-friendly are converted to PNG files.

Wiki Marks

The wiki style is easy to use, yet doesn't get in the way when you don't want it. You can generally mix and match wiki marks with XHTML without any problems.

One basic restriction that applies to all wiki marks is that they only work on a single line.

Font styles

There are four font styles that can be activated via wiki marks:

*bold* -> bold

/italics/ -> italics

_underline_ -> underline

-strikeout- -> strikeout

To prevent accidental transformations, they are only triggered if they wrap words or phrases. Even a space before or after (e.g., * foo * ) will prevent anything from happening. Punctuation is not considered to start a word.

As a side effect of that, you cannot nest them one after the other: */bold italics?/* becomes /bold italics?/. However, there will likely be an exception added to allow that.

Headers

The wiki marks for the headers are an equal number of equal signs that begin and end a line.

= H1 = == H2 == etc...

The end lines are relative to the original text format. Something like this will not work:

<quote>= H1 =</quote>

Lists

Lists are much easier to use with wiki marks than with XHTML tags.

Simple List

The first character must be an asterisk followed by a single space.

* line one
* line two

line one

line two

Double Spacing

You can double space lists as exepected.

* line one
* line two
* double space

line one

line two

double space

Nested List

Each nested layer must line up precisely under the previous layer. Anything else will 'break' the list.

* A
* A.1
* A.2
* B

A

A.1

A.2

B

Lists with Paragraphs

You can use paragraphs with wiki lists as long as you maintain the indentation level.

* First Paragraph.
Second Paragraph.
* Next point.

First Paragraph

Second Paragraph

Next point.

Ordered Lists

Replace the asterisk with a pound (#) sign to use number lists.

# Point #1
# Point #2

Point #1

Point #2

Links

As before, any plain text link will be transformed into an active web link.

When I shift click on the image, it becomes fullscreen, with no way other than alt-f4 to close the window.

I tried to upload a screenshot as a jpeg, but it stalled at 6% I clicked the attachment button to hide it, and now when I try and click it to bring down the form, it doesn't do anything.

But keep up the good work.

Oh and I cant submit the post because of the attachment issue. Time to cut and paste to a new post.

____________________________________________________________________________________________"c is much better than c++ if you don't need OOP simply because it's smaller and requires less load time." - alethiophileOMG my sides are hurting from laughing so hard... :D

Interesting. I would have liked if you could have implemented the MediaWiki way of marking italics (two single quotes) and bold (three single quotes), like ''italics'' and '''bold''' too, since you already use the links and lists that are standard.

I would ask three things for the referencing. The first is that the small number in the reference section links to where the reference is used (in large posts, if you click a reference and go to a new section, it is a pain to locate the position again). The second is to highlight the reference that has been clicked. The third is that when you jump to the reference, it is hidden by the navigation bar at the top, so it is pretty much unusable right now. Well, it is usable as long as you don't click the reference number

Can we have a reverse reveal option on a reveal? Just in case somebody is referencing something which is rather long but there's stuff below and you want to hide it again?

btw, I pasted in some wiki and the <spoiler> tags disappeared as did the text beneath it.

Early years and league triumphs
Sunderland-based schoolteacher James Allan founded the Sunderland & District Teachers Association Football Club on 17 October 1879.[3] The name of the club was changed to Sunderland Association Football Club in 1881, after other professions were allowed to join. This increased the pool of players and improved the club's financial base.[4] However, Allan grew dissatisfied with the changing attitude in the club towards professionalism.[5] He left to found Sunderland Albion, and the two Sunderland clubs formed a rivalry that lasted until Albion's demise in 1892.[5]
Sunderland were admitted into The Football League for the 1890–91 season. They replaced Stoke City, who had failed to be re-elected, becoming the first new club to join the league since its inauguration in 1888.[6] During the late 19th century, they were declared the "Team of All Talents" by William McGregor,[7] the founder of the league, after a 7–2 win against Aston Villa. Sunderland won the league championship in the 1891–92 season, one season after joining The Football League. The club's 42 points were five clear of nearest rivals Preston North End, and this performance led The Times to describe the players as "a wonderfully fine team".[2] Sunderland successfully defended the title the following season, aided by centre forward Johnny Campbell, who broke the 30-goal mark for the second time in consecutive seasons. In the process, they became the first team to score 100 goals in a season, a feat not matched until 1919–20, when West Bromwich Albion set a new record.[8]
Sunderland came close to winning a third successive league championship in the 1893–94 season, finishing second behind Aston Villa. However, they regained the title in the 1894–95 season, ending the season five points ahead of Everton. After winning the English League Championship, Sunderland played against Heart of Midlothian, the champions of the Scottish League, in a game described as the Championship of the World title match.[9] Sunderland won the game 5–3 and were announced "champions of the world".[10] Sunderland came close to winning another league title in the 1897–98 season, when they finished as runners-up to Sheffield United.[11] That season was their last at Newcastle Road, as they moved to Roker Park the following season.[12] After coming second in 1900–01, the club won their fifth league title in the 1901–02 season, beating Everton by a three point margin.[13]
In 1904, Sunderland's management was embroiled in a payment scandal involving player Andrew McCombie. The club was said to have given the player £100 (£7,700 today) to help him start his own business, on the understanding that he would repay the money after his benefit game.[14] However, McCombie refused to repay the money, claiming it had been a gift. An investigation conducted by the Football Association concluded that the money given to McCombie was part of a "re-signing/win/draw bonus", which violated the Association's rules. Sunderland were fined £250 (£19,300 today), and six directors were suspended for two and a half years for not showing a true record of the club's financial dealings. Sunderland manager Alex Mackie was also suspended for three months for his involvement in the affair.[14][15]
[edit] Further league championship titles
On 5 December 1908, Sunderland achieved their highest ever league win, against north-east rivals Newcastle United. They won the game 9–1; Billy Hogg and George Holley each scored hat-tricks.[16] The club won the league again in 1913,[17] but lost their first FA Cup final 1–0 to Aston Villa.[18] This was the closest the club has come to winning the league title and the FA Cup in the same season.[19] Two seasons later the First World War brought the league to a halt. After the league's resumption, Sunderland came close to winning another championship in the 1922–23 season, when they were runners-up to Liverpool.[20] They also came close the following season, finishing third, four points from the top of the league.[21] The club escaped relegation from the First Division by one point in the 1927–28 season despite 35 goals from Dave Halliday. The point was won in a match against Middlesbrough, and they finished in fifteenth place.[22] Halliday improved his goal scoring to 43 goals in 42 games the following season,[23] an all-time Sunderland record for goals scored in a single season.[24]
The club's sixth league championship came in the 1935–36 season,[25] and they won the FA Cup the following season, after a 3–1 victory against Preston North End at Wembley Stadium.[26] The remainder of the decade saw mid-table finishes, until the league and FA Cup were suspended for the duration of the Second World War. Some football was still played as a morale boosting exercise, in the form of the Football League War Cup. Sunderland were finalists in the tournament in 1942, but were beaten by Wolverhampton Wanderers.[27]
For Sunderland, the immediate post-war years were characterised by significant spending; the club paid £18,000 (£458,000 today) for Carlisle United's Ivor Broadis in January 1949.[14] Broadis was also Carlisle's manager at the time, and this is the first instance of a player transferring himself to another club.[28] This, along with record-breaking transfer fees to secure the services of Len Shackleton and Welsh international Trevor Ford, led to a contemporary nickname, the "Bank of England".[29] The club finished third in the First Division in 1950,[30] their highest finish since the 1936 championship.
[edit] Financial troubles and cup success
The late 1950s saw a sharp downturn in Sunderland's fortunes, and the club was once again implicated in a major financial scandal in 1957.[15] Found guilty of making payments to players in excess of the maximum wage, they were fined £5,000 (£87,000 today), and their chairman and three directors were suspended.[14][31][32] The following year, Sunderland were relegated from the highest division for the first time in their 68-year league history.[33]
Sunderland's absence from the top flight lasted six years. The club came within one game of promotion back to the First Division in the 1962–63 season. Sunderland required only a draw in their final game against promotion rivals Chelsea, who had another game left to play after this match, to secure promotion. However, they were defeated,[34] and Chelsea won their last game 7–0 to clinch promotion, finishing ahead of Sunderland on goal difference.[35] After the close call in the previous season, the club was promoted to Division One in 1964 after finishing in second place. Sunderland beat Charlton Athletic in the final stages of the season, where they clinched promotion with a game to spare.[36] At the end of the decade, they were again relegated to the Second Division after finishing 21st.[37]
The memorial for 1973 FA Cup final winning manager Bob Stokoe
Sunderland won their last major trophy in 1973, in a 1–0 victory over Don Revie's Leeds United in the FA Cup Final.[38] A Second Division club at the time, Sunderland won the game, mostly thanks to the efforts of their goalkeeper Jimmy Montgomery, who saved two of Peter Lorimer's shots at goal in quick succession.[39] Ian Porterfield scored a volley in the 30th minute to beat Leeds and take the trophy.[39] Since 1973 only two other clubs, Southampton in 1976,[40] and West Ham United in 1980,[41] have equalled Sunderland's achievement of lifting the FA Cup while playing outside the top tier of English football.
By winning the 1973 FA Cup Final, Sunderland qualified for the UEFA Cup Winners' Cup, the club's only appearance in European competition to date.[42] Sunderland beat Vasas Budapest 3–0 on aggregate, and were drawn against Lisbon club Sporting in the second round.[42] They won the first leg at Roker Park 2–1 but were defeated 2–0 in the away leg, and were knocked out of the competition 3–2 on aggregate.[42] After spending six seasons in the Second Division, Sunderland were promoted to Division One in the 1975–76 season; they topped the table over Bristol City by three points.[43] However, Sunderland were relegated the following season back into Division Two, without their FA Cup Final winning manager Bob Stokoe, who had resigned because of health problems at the start of the season.[44] The club celebrated its 100-year centenary in the 1979–80 season with a testimonial against an England XI side, which they lost 2–0.[45]
Sunderland appeared in their only League Cup final in 1985, but lost 1–0 to Norwich City.[46] A camaraderie was forged between supporters of the two clubs in this match, and as a result, every time Sunderland and Norwich meet, the Friendship Trophy is contested.[47] Sunderland are the current holders of the trophy, having beaten Norwich 1–0 on 2 December 2006.[48] In 1987, Sunderland saw one of the lowest points in their history, when they were relegated to the Third Division of the English league for the first time.[49] Under new chairman Bob Murray and new manager Denis Smith, the club was promoted the following season.[50] In 1990, they were promoted back to the top flight in unusual circumstances. Sunderland lost to Swindon Town in the play-off final, but Swindon's promotion was revoked after the club was found guilty of financial irregularities and Sunderland were promoted instead.[51] They stayed up for one year before being relegated on the final day of the following season.[52]
The Davy lamp monument, outside the Stadium of Light
Sunderland's last outing in a major final came in 1992 when, as a Second Division club, they returned to the FA Cup final. There was to be no repeat of the heroics of 1973, as Sunderland lost 2–0 to Liverpool.[53] The early 1990s was a turbulent period for the club. In 1995, they faced the prospect of a return to the third-tier of English football.[54] Peter Reid was brought in as manager, and quickly turned things around. Reid's time in charge had a stabilising effect; he remained manager for seven years, one of the longest tenures in Sunderland's history.[55] After promotion from Division One in the 1995–96 season, Sunderland began their first season in the Premier League, but finished third from the bottom and were relegated back to the First Division.[56] In 1997, Sunderland left Roker Park, their home for 99 years. Bearing fond memories of the stadium, former Sunderland player Len Shackleton said, "There will never be another place like Roker".[57] The club moved to the Stadium of Light, a 42,000-seat arena that, at the time, was the largest stadium built in England after the Second World War.[58] Capacity was later increased to 49,000.[58]
[edit] Recent highs and lows
Sunderland returned to the Premier League as First-Division champions in 1999 with a then-record 105 points.[59] Two consecutive seventh place finishes in the Premier League were followed by two less successful seasons, and they were relegated to the second-tier with a then-record low 19 points in 2003.[60][61] Former Ireland manager Mick McCarthy took over at the club, and, in 2005, he took Sunderland up as champions for the third time in less than ten years.[62] However, the club's stay in the top flight was short-lived; Sunderland finished on another new record-low total of 15 points.[61] McCarthy left the club in mid-season, and he was replaced temporarily by former Sunderland player Kevin Ball.[62] The record-low fifteen-point performance was surpassed in the 2007–08 season by Derby County, who finished on eleven points.[63]
Following the club's relegation, it was taken over by the Irish Drumaville Consortium,[64] headed by ex-player Niall Quinn, who appointed former Manchester United captain Roy Keane as the new manager.[65] Under Keane, the club rose steadily up the table with an unbeaten run of 17 games[66] to win promotion to the Premier League,[67] and were named winners of the Championship after beating Luton Town 5–0 at Kenilworth Road on 6 May 2007.[68] The club's form in the 2007–08 season was better than during their last season in the Premier League, as they finished 15th with 39 points.[69] Following an inconsistent start to the 2008–09 season Keane resigned. First team coach Ricky Sbragia took over as caretaker manager, and his position was later made permanent.

Just as a technical question to Mathew, Did you have to change all the previous threads to the new mockup format?

Based on what I have seen, I think the site uses the go-live date to determine which markup engine to use. If you edit a post that was created before it, the original BBCode is still there and you will have to manually update it for the desired output (because the date will be updated along with it).

Also, you should some kind of automatic quoting feature that automatically fills in the name and the source.

It should be trivial to write some custom JS to do this if ML doesn't. I was thinking that it would be convenient if in the absence of a name attribute it would check the src attribute for an Allegro.cc recognized URL format and automatically grab the user id (the first time and then update the post with it), but I can understand how that's asking a lot.