Closed eviltrout closed 10 years ago
Trying to think if this breaks the JsonML format we've got (well makes it inconsistent) or not - in your previous PR for instance it could be 'fixed' by just doing return [ this.processInline(block) ]
but my brain isn't working properly right now and I can't reason one way or another.
Anyone else care to weigh in?
I just tested it and the previous method also complained when I return [ this.processInline(block) ]
without this patch.
Yeah that wouldn't work - its not a valid block in JsonML. I said my brain wasn't working right?
So I guess the question is should a block-level markdown element be able to return a string literal?
I think so, yes. It's rare but sometimes you just want to return a string without a tag. The renderer and everything works perfectly with it as far as I can tell in my tests with Discourse. The only issue seems to be the debugging message :)
My previous pull request to not surround HTML with paragraphs was not accepted. It contained this other fix which I think is still worth having on its own: JsonML supports strings of text, not just tags.
This patch changes the warning message to not complain when the text is a string either.