fix emdash/endash confusion
authorAdam Megacz <adam@megacz.com>
Mon, 24 Jan 2011 01:57:40 +0000 (17:57 -0800)
committerAdam Megacz <adam@megacz.com>
Mon, 24 Jan 2011 01:57:40 +0000 (17:57 -0800)
src/Doc.scala
src/wix.g

index 1a6d322..7912eb3 100644 (file)
@@ -52,7 +52,8 @@ object Doc {
       case Tree("(r)",  _               ,_) => Seq(new GlyphText(CircleR))
       case Tree("(c)",  _               ,_) => Seq(new GlyphText(CircleC))
       case Tree("(tm)", _               ,_) => Seq(new GlyphText(TradeMark))
       case Tree("(r)",  _               ,_) => Seq(new GlyphText(CircleR))
       case Tree("(c)",  _               ,_) => Seq(new GlyphText(CircleC))
       case Tree("(tm)", _               ,_) => Seq(new GlyphText(TradeMark))
-      case Tree("--",   _               ,_) => Seq(new GlyphText(Emdash))
+      case Tree("--",   _               ,_) => Seq(new GlyphText(Endash))
+      case Tree("---",  _               ,_) => Seq(new GlyphText(Emdash))
       case Tree("<-",   _               ,_) => Seq(new GlyphText(LeftArrow))
       case Tree("<=",   _               ,_) => Seq(new GlyphText(DoubleLeftArrow))
       case Tree("=>",   _               ,_) => Seq(new GlyphText(DoubleRightArrow))
       case Tree("<-",   _               ,_) => Seq(new GlyphText(LeftArrow))
       case Tree("<=",   _               ,_) => Seq(new GlyphText(DoubleLeftArrow))
       case Tree("=>",   _               ,_) => Seq(new GlyphText(DoubleRightArrow))
@@ -338,6 +339,7 @@ abstract class Glyph extends ToHtml
   case object CircleC extends Glyph { override def toHtml = "&#174;" }
   case object TradeMark extends Glyph { override def toHtml = "&#8482;" }
   case object ServiceMark extends Glyph { override def toHtml = "&#8482;" }
   case object CircleC extends Glyph { override def toHtml = "&#174;" }
   case object TradeMark extends Glyph { override def toHtml = "&#8482;" }
   case object ServiceMark extends Glyph { override def toHtml = "&#8482;" }
+  case object Endash extends Glyph { override def toHtml = "&ndash;" }
   case object Emdash extends Glyph { override def toHtml = "&mdash;" }
   case object Ellipsis extends Glyph { override def toHtml = "&#0133;"  /* &cdots;? */ }
   case object Cent extends Glyph { override def toHtml = "&#189;" }
   case object Emdash extends Glyph { override def toHtml = "&mdash;" }
   case object Ellipsis extends Glyph { override def toHtml = "&#0133;"  /* &cdots;? */ }
   case object Cent extends Glyph { override def toHtml = "&#189;" }
index 003cd36..348ce40 100644 (file)
--- a/src/wix.g
+++ b/src/wix.g
@@ -92,7 +92,7 @@ styled              = Underline::     "__"       Text                       "__"
                     | Keyword::       "!"        Atom
                     | Italic::        "**"      (Text & ((~[\*]! | "*" -> ~[\*])*))      "**"
 
                     | Keyword::       "!"        Atom
                     | Italic::        "**"      (Text & ((~[\*]! | "*" -> ~[\*])*))      "**"
 
-glyph               = ^"(e)" | ^"(r)" | ^"(c)" | ^"(tm)" | ^"--"
+glyph               = ^"(e)" | ^"(r)" | ^"(c)" | ^"(tm)" | ^"--" | ^"---"
                     | ^"..." | ^"<-" | ^"<=" | ^"=>" | ^"<->"
                     | ^"<=>" | ^"<-" | ^"^o"
                     // ^"->"
                     | ^"..." | ^"<-" | ^"<=" | ^"=>" | ^"<->"
                     | ^"<=>" | ^"<-" | ^"^o"
                     // ^"->"