Esempio n. 1
0
 def test_simple_tokens_option(self):
     Base = creole10_base()
     class MyDialect(Base):
         simple_element = SimpleElement(token_dict={'*':'strong','#':'code'})
     parse = Parser(MyDialect)
     self.assertEquals(
         parse("This block of #text *should* be monospace# now"),
         wrap_result("This block of <code>text <strong>should</strong> be monospace</code> now"))
Esempio n. 2
0
 def test_simple_tokens_option(self):
     Base = creole10_base()
     class MyDialect(Base):
         simple_element = SimpleElement(token_dict={'*':'strong','#':'code'})
     parse = Parser(MyDialect)
     self.assertEquals(
         parse("This block of #text *should* be monospace# now"),
         wrap_result("This block of <code>text <strong>should</strong> be monospace</code> now"))
Esempio n. 3
0
 def test_disable_images(self):
     Base = creole10_base()
     class MyDialect(Base):
         @property
         def inline_elements(self):
             l = super(MyDialect,self).inline_elements
             l.remove(self.img)
             return l
     parse = Parser(MyDialect)
     self.assertEquals(
         parse("{{somefile.jpg}}"),
         wrap_result("{{somefile.jpg}}"))
Esempio n. 4
0
 def test_disable_images(self):
     Base = creole10_base()
     class MyDialect(Base):
         @property
         def inline_elements(self):
             l = super(MyDialect,self).inline_elements
             l.remove(self.img)
             return l
     parse = Parser(MyDialect)
     self.assertEquals(
         parse("{{somefile.jpg}}"),
         wrap_result("{{somefile.jpg}}"))