Talk:Markup spec/BNF

Latest comment: 14 years ago by Kanor in topic Nonsense redirect

Nonsense redirect

edit

I tried the "nonsense redirect" example (here), and it seems that it does not work anymore.

--Skagedal 13:32, 10 December 2008 (UTC)Reply

Why shouldn't be possible to describe the italics/bold/apostrophe parsing with BNF? Those elements are indeed being translated into HTML, and HTML is a context free grammar as far as I know. BNF can indeed describe context free grammars.

Let's say, in EBNF:

emphasis = "''" text "''"
bold = "'''" text "'''"

text = character* | emphasis | bold | character *

Of course making many simplifications, but as far as I know it should be possible.

--Kanor 17:55, 24 November 2009 (UTC)Reply

Concerning the lists, and as far as I know, the lists can be also generated with a context-free grammar (as I have already been discussing in User_talk:Kanor). In fact the rules are:

list = list-item+
list-item =  level-mark+ , text-line

Because in fact, and pretty much like in html, there is no restriction or relation between the previous level and the current level (even thought that some combinations would not make sense).

--Kanor 12:18, 25 November 2009 (UTC)Reply

Return to "Markup spec/BNF" page.