rtomayko / ronn

the opposite of roff
http://rtomayko.github.com/ronn/
Other
1.36k stars 84 forks source link

Change \(bu to \[ci] for utf8 encoding #70

Closed tmpfs closed 11 years ago

tmpfs commented 11 years ago

This may seem a little strange, it's more aesthetic then anything else. When troff is run with -Kutf8 -Tutf8 to ensure that utf8 characters appear correctly then the bullets generated by \(bu appear as small squares (I'm using 13pt Pragmata Pro).

My suggestion is that the \[ci] marker is used so that bullets are always formatted nicely. This does not affect the html output of course. Trivial patch below:

--- roff.rb 2013-02-09 23:25:00.000000000 +0100
+++ roff.rb.new 2013-02-09 23:25:25.000000000 +0100
@@ -141,7 +141,7 @@
           when 'ol'
             macro "IP", %W["#{node.position + 1}." 4]
           when 'ul'
-            macro "IP", %w["\(bu" 4]
+            macro "IP", %w["\\\[ci\]" 4]
           end
           if node.at('p|ol|ul|dl|div')
             block_filter(node.children)

I'd rather do this in troffrc but have been unable to work out how to map \(bu to another character :(

Thanks for merging the other patch!

rtomayko commented 11 years ago

Seems fine to me. I'll pull this in next time I do a pass over ronn issues and pull requests. If you'd like to get a pull request and check that test suite is okay, I can merge sooner.

Thanks for the patch!

tmpfs commented 11 years ago

Cool, just doing this now. I also needed to update HTML_ROFF_ENTITIES. I've also fixed the tests related to this change but one (seemingly unrelated) test test_backticks_HTML is failing and it appears to be because of the attribute order in the markup. Not sure if I broke this test or not.

rtomayko commented 11 years ago

Merged in #71.