From 63fb8f2255d96664dde98015e7f0661d8d9bafbe Mon Sep 17 00:00:00 2001
From: Raniere Silva <raniere@ime.unicamp.br>
Date: Thu, 7 May 2015 12:13:05 -0300
Subject: [PATCH] Replace div with section and aside

to make the HTML more semantic.

No visual change was made.

Close #231.
---
 tools/filters/blockquote2div.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/filters/blockquote2div.py b/tools/filters/blockquote2div.py
index 485b770..eca39c7 100755
--- a/tools/filters/blockquote2div.py
+++ b/tools/filters/blockquote2div.py
@@ -113,7 +113,16 @@ def blockquote2div(key, value, format, meta):
 
             # a blockquote is just a list of blocks, so it can be
             # passed directly to Div, which expects Div(attr, blocks)
-            return pf.Div((id, classes, kvs), [panel_header, panel_body])
+            if classes[0] == "callout":
+                return [{"t": "RawBlock", "c": [ "html", "<aside class=\"{0}\">".format(' '.join(classes)) ]},
+                        panel_header,
+                        panel_body,
+                        {"t": "RawBlock", "c": [ "html", "</aside>" ]}]
+            else:
+                return [{"t": "RawBlock", "c": [ "html", "<section class=\"{0}\">".format(' '.join(classes)) ]},
+                        panel_header,
+                        panel_body,
+                        {"t": "RawBlock", "c": [ "html", "</section>" ]}]
 
 
 if __name__ == '__main__':
-- 
GitLab