From t_leitner at gmx.at Fri Mar 4 10:01:45 2011 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 4 Mar 2011 16:01:45 +0100 Subject: [kramdown-users] Proposal: new option for disabling smart quotes/typography parsers Message-ID: <20110304160145.4c1802d8@noweto> Hello everybody, there is a feature request for an option to exclude arbitrary span/block parsers from the kramdown parser, see [1]. I don't think that this would be a good idea. However, the reason why Justin wants this option is to disable the smart quotes/typography parsers so that RubyPants/typogruby and kramdown work better together. Since the smart quotes/typography parsers are partly based on RubyPants anyway and they don't interfere with other span parsers, I think it would be okay to provide an option for disabling them. We could call the option "parse_typographic_symbols" with a default value of true. What do you think? Best regards, Thomas [1]: http://rubyforge.org/tracker/index.php?func=detail&aid=28992&group_id=7403&atid=28676 From matt at tidbits.com Fri Mar 4 13:51:00 2011 From: matt at tidbits.com (Matt Neuburg) Date: Fri, 4 Mar 2011 10:51:00 -0800 Subject: [kramdown-users] Proposal: new option for disabling smart quotes/typography parsers In-Reply-To: <20110304160145.4c1802d8@noweto> References: <20110304160145.4c1802d8@noweto> Message-ID: <7C03341C-EB93-4249-94C5-BD6B3C69F2DF@tidbits.com> On Mar 4, 2011, at 7:01 AM, Thomas Leitner wrote: > there is a feature request for an option to exclude arbitrary > span/block parsers from the kramdown parser, see [1]. I don't think > that this would be a good idea. > > However, the reason why Justin wants this option is to disable the > smart quotes/typography parsers so that RubyPants/typogruby and > kramdown work better together. Since the smart quotes/typography > parsers are partly based on RubyPants anyway and they don't interfere > with other span parsers, I think it would be okay to provide an option > for disabling them. We could call the option > "parse_typographic_symbols" with a default value of true. > > What do you think? > > Best regards, > Thomas I've been requesting this since the first day I joined this list. The only thing I don't get is why you take Justin seriously and you basically told me to stick it where the sun didn't shine. m. -- matt neuburg, phd = matt at tidbits.com, http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, http://www.tidbits.com From t_leitner at gmx.at Fri Mar 4 17:15:22 2011 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 4 Mar 2011 23:15:22 +0100 Subject: [kramdown-users] Proposal: new option for disabling smart quotes/typography parsers In-Reply-To: <7C03341C-EB93-4249-94C5-BD6B3C69F2DF@tidbits.com> References: <20110304160145.4c1802d8@noweto> <7C03341C-EB93-4249-94C5-BD6B3C69F2DF@tidbits.com> Message-ID: <20110304231522.0b7cb372@noweto> On 2011-03-04 10:51 -0800 Matt Neuburg wrote: > I've been requesting this since the first day I joined this list. The > only thing I don't get is why you take Justin seriously and you > basically told me to stick it where the sun didn't shine. m. I may have written the previous mail prematurely... So, after having read through my TODO list and other mails, I think that the current way of *not* modifying the kramdown parser is the right way to go. What to do if one doesn't want smart quotes or nice typographic symbols? 1. Subclass the kramdown parser and remove the parsing methods for smart quotes and typographic symbols. 2. Subclass the HTML converter and use the convert_smart_quote and convert_typographic_sym from the kramdown converter. 3. If you are using Ruby 1.9: use the option `smart_quotes` to convert the smart quotes to simple quote characters by setting the proper entity names/entity numbers. 4. Change the smart_quote/typographic_sym Entity objects to contain just the needed text before converting to HTML, LaTeX, ... -- Thomas From michaelfranzl at gmx.at Sun Mar 27 05:15:57 2011 From: michaelfranzl at gmx.at (Michael Franzl) Date: Sun, 27 Mar 2011 11:15:57 +0200 Subject: [kramdown-users] LaTeX conversion of kramdown images broken? Message-ID: <4D8F004D.2060302@gmx.at> kramdown-0.13.2 with Ruby 1.9.2 apparently can't convert an image ![alt](image.jpg) to LaTeX any more: /home/path/.rvm/gems/ruby-1.9.2-p136/gems/kramdown-0.13.2/lib/kramdown/converter/latex.rb:231:in `convert_img': undefined method `attr' for {}:Hash (NoMethodError) HTML conversion works. kramdown-0.10.0 works too. Michael