Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: cms/converters.py

Issue 5634661371871232: Issue 2134 - Support both .raw and .html file extensions for raw HTML (Closed)
Patch Set: Created March 12, 2015, 7:43 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2015 Eyeo GmbH 4 # Copyright (C) 2006-2015 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 structured = [] 328 structured = []
329 stack = [{"level": 0, "subitems": structured}] 329 stack = [{"level": 0, "subitems": structured}]
330 for item in flat: 330 for item in flat:
331 while stack[-1]["level"] >= item["level"]: 331 while stack[-1]["level"] >= item["level"]:
332 stack.pop() 332 stack.pop()
333 stack[-1]["subitems"].append(item) 333 stack[-1]["subitems"].append(item)
334 stack.append(item) 334 stack.append(item)
335 return structured 335 return structured
336 336
337 converters = { 337 converters = {
338 "raw": RawConverter, 338 "raw": RawConverter,
Sebastian Noack 2015/03/12 20:05:10 Should you remove the old extension?
Wladimir Palant 2015/03/12 20:46:28 As I said in the issue description - we have repos
Sebastian Noack 2015/03/12 20:48:09 Sorry, too late, but please add a comment above th
Wladimir Palant 2015/03/12 20:59:11 Done.
339 "html": RawConverter,
339 "md": MarkdownConverter, 340 "md": MarkdownConverter,
340 "tmpl": TemplateConverter, 341 "tmpl": TemplateConverter,
341 } 342 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld