1. wladislaw
  2. semanticeditor

Commits

Luke Plant  committed 2e126db

Fixed bug with titles not showing up in preview box

Always use lowercase internally for tags.

  • Participants
  • Parent commits 0b2fbbc
  • Branches default

Comments (0)

Files changed (3)

File semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

View file
 /*
  * Plugin for WYMEditor that provides an interface to allow separation
  * of presentation and content by allowing the user to select presentation
- * elements for each section.  Depends on a server-side backed to do
+ * elements for each section.  Depends on a server-side backend to do
  * parsing and provide list of allowed CSS classes.
  */
 

File semanticeditor/tests.py

View file
 <h6>level 6</h6>
 <h1>Heading two</h1>
 """)],
-        [(1, "h1_1", u"Heading with embedded stuff in it", u"H1"),
-         (2, "p_1", u"A long paragraph wit...", u"P"),
-         (2, "h2_1", u"A sub heading", u"H2"),
-         (3, "p_2", u"Another para...", u"P"),
-         (3, "h3_1", u"level 3", u"H3"),
-         (4, "p_3", u"A long paragraph wit...2", u"P"),
-         (4, "h4_1", u"level 4", u"H4"),
-         (5, "p_4", u"Another para...2", u"P"),
-         (5, "h5_1", u"level 5", u"H5"),
-         (6, "p_5", u"nasty  ééééééééééééé...", u"P"),
-         (6, "h6_1", u"level 6", u"H6"),
-         (1, "h1_2", u"Heading two", u"H1"),
+        [(1, "h1_1", u"Heading with embedded stuff in it", u"h1"),
+         (2, "p_1", u"A long paragraph wit...", u"p"),
+         (2, "h2_1", u"A sub heading", u"h2"),
+         (3, "p_2", u"Another para...", u"p"),
+         (3, "h3_1", u"level 3", u"h3"),
+         (4, "p_3", u"A long paragraph wit...2", u"p"),
+         (4, "h4_1", u"level 4", u"h4"),
+         (5, "p_4", u"Another para...2", u"p"),
+         (5, "h5_1", u"level 5", u"h5"),
+         (6, "p_5", u"nasty  ééééééééééééé...", u"p"),
+         (6, "h6_1", u"level 6", u"h6"),
+         (1, "h1_2", u"Heading two", u"h1"),
          ])
 
     def test_extract_structure_missing(self):

File semanticeditor/utils/presentation.py

View file
     level = 0     #    level is the 'outline level' in the document i.e. an integer
     sect_id = ''  #    sect_id is a unique ID used for storing presentation information against
     name = ''     #    name is a user presentable name for the section
-    tag = ''      #    tag is the HTML element e.g. H1
+    tag = ''      #    tag is the HTML element e.g. h1
     node = None   #    node is the ElementTree node
 
 
             retval.append(StructureItem(level=nesting_level + level - first_heading_level + 1,
                                         sect_id=sect_id,
                                         name=name,
-                                        tag=n.tag.upper(),
+                                        tag=n.tag.lower(),
                                         node=n))
 
     return retval