Hi,
Textmate incorrectly labels italicised and bolded text.
In the following markdown: "this is s_om_e markdown", 'om' will be tagged as italicised. When converting to HTML, 'om' will not be italicised. I am guessing that the Markdown processor requires that italicised text be surrounded by white space. The same is also true for bolded text.
I was able to modify the language grammar to not incorrectly tag the text. My solution is probably quite naive but it did work for me. Can someone with more regex fu vet this and can we get it added to the official bundle please (assuming it should be added and I am not wrong on this).
Luke.
According to the syntax guide at http://daringfireball.net/projects/ markdown/syntax#em:
Emphasis can be used in the middle of a word: un*fucking*believable
Also, I pasted your “this is s_om_e markdown” example into a new document and did Preview and the “om” was indeed italicised.
Ciarán
On 21 Mar 2007, at 06:15, Luke Daley wrote:
Hi,
Textmate incorrectly labels italicised and bolded text.
In the following markdown: "this is s_om_e markdown", 'om' will be tagged as italicised. When converting to HTML, 'om' will not be italicised. I am guessing that the Markdown processor requires that italicised text be surrounded by white space. The same is also true for bolded text.
I was able to modify the language grammar to not incorrectly tag the text. My solution is probably quite naive but it did work for me. Can someone with more regex fu vet this and can we get it added to the official bundle please (assuming it should be added and I am not wrong on this).
<Markdown.diff>
Luke.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 21/03/2007, at 7:13 PM, Ciarán Walsh wrote:
According to the syntax guide at http://daringfireball.net/projects/ markdown/syntax#em:
Emphasis can be used in the middle of a word: un*fucking*believable
Also, I pasted your “this is s_om_e markdown” example into a new document and did Preview and the “om” was indeed italicised.
Ciarán
cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/ Markdown.tmbundle/Support/bin echo "bl_a_h" | ./MultiMarkdown.pl
gives me
<p>bl_a_h</p>
Perhaps this is an issue with MultiMarkdown?
Luke.
On 3/22/07, Luke Daley ld@ldaley.com wrote:
cd /Applications/TextMate.app/Contents/SharedSupport/Bundles/ Markdown.tmbundle/Support/bin echo "bl_a_h" | ./MultiMarkdown.pl
gives me
<p>bl_a_h</p>
Perhaps this is an issue with MultiMarkdown?
Luke.
This is the normal MultiMarkdown behaviour[1].
- and _ are not interpreted as <strong> or <em> when they occur in the middle of words. This caused too many problems with URL's.
[1]:http://fletcher.freeshell.org/wiki/MultiMarkdown
-- FredB
On 22/03/2007, at 9:18 AM, Fred B wrote:
This is the normal MultiMarkdown behaviour[1].
Ah. So when does the Markdown bundle use Markdown and when does it use MultiMarkdown? And how can we differentiate between the two in terms of language grammar?
I am happy to just make the modifications locally to suit myself if this is not bothering anyone else. It may be worth fixing though as it makes the syntax highlighting in TextMate misleading if it is actually going to be piped through MultiMarkdown.
--
Luke Daley
On Mar 21, 2007, at 7:27 PM, Luke Daley wrote:
Ah. So when does the Markdown bundle use Markdown and when does it use MultiMarkdown? And how can we differentiate between the two in terms of language grammar?
The Markdown bundle contains two language grammars, one for Markdown and one for MultiMarkdown. If what you want is Markdown behavior, then the fix is easy: just set the language to Markdown.
The Preview and Convert to HTML commands behave differently depending on how you call them. If you are using the shortcut keys (⌃⌥⌘P and ⌃⇧H) to invoke them then they do the right thing based on the language setting for the current document. If you invoke them via the menu then it depends which individual command you invoke. The commands in the main Markdown menu relate to Markdown; there are MultiMarkdown commands in the MultiMarkdown submenu, and those will work according to MultiMarkdown rules. So using the shortcut keys it'll just work; using the menu it's possible to produce an improper result.
I am happy to just make the modifications locally to suit myself if this is not bothering anyone else. It may be worth fixing though as it makes the syntax highlighting in TextMate misleading if it is actually going to be piped through MultiMarkdown.
The problem is that the MultiMarkdown language grammar inherits its knowledge of italic/bold handling from the Markdown grammar, thus they highlight syntax the same way even if the output you get is different.
I was going to take a stab at fixing this but I took one look at the regex used for italic handling in Markdown and decided it was a bit more than I am going to try to absorb at this time of night. :-)
-dan
Luke Daley wrote:
On 22/03/2007, at 9:18 AM, Fred B wrote:
This is the normal MultiMarkdown behaviour[1].
Ah. So when does the Markdown bundle use Markdown and when does it use MultiMarkdown? And how can we differentiate between the two in terms of language grammar?
The grammar tries to follow the markdown syntax as much as possible (notwithstanding bugs in the perl markdown implementation). Unfortunately, Multimarkdown diverges from that standard, and breaks compatibility with Markdown in the process. Orphaned (i.e. without a title) links should be surrounded by angle brackets, e.g. http://google.com. This will cause included underscores to be ignored, in markdown and multimarkdown both.
-Jacob