aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown.py')
-rwxr-xr-xmarkdown.py641
1 files changed, 240 insertions, 401 deletions
diff --git a/markdown.py b/markdown.py
index b534151..b40093f 100755
--- a/markdown.py
+++ b/markdown.py
@@ -98,24 +98,6 @@ INLINE_PLACEHOLDER_PREFIX = STX+"klzzwxh:"
INLINE_PLACEHOLDER = INLINE_PLACEHOLDER_PREFIX + "%s" + ETX
AMP_SUBSTITUTE = STX+"amp"+ETX
-def wrapRe(raw_re) : return re.compile("^%s$" % raw_re, re.DOTALL)
-CORE_RE = {
- 'header': wrapRe(r'(#{1,6})[ \t]*(.*?)[ \t]*(#*)'), # # A title
- 'reference-def': wrapRe(r'(\ ?\ ?\ ?)\[([^\]]*)\]:\s*([^ ]*)(.*)'),
- # [Google]: http://www.google.com/
- 'containsline': wrapRe(r'([-]*)$|^([=]*)'), # -----, =====, etc.
- 'ol': wrapRe(r'[ ]{0,3}[\d]*\.\s+(.*)'), # 1. text
- 'ul': wrapRe(r'[ ]{0,3}[*+-]\s+(.*)'), # "* text"
- 'isline1': wrapRe(r'(\**)'), # ***
- 'isline2': wrapRe(r'(\-*)'), # ---
- 'isline3': wrapRe(r'(\_*)'), # ___
- 'tabbed': wrapRe(r'((\t)|( ))(.*)'), # an indented line
- 'quoted': wrapRe(r'[ ]{0,2}> ?(.*)'), # a quoted block ("> ...")
- 'containsline': re.compile(r'^([-]*)$|^([=]*)$', re.M),
- 'attr': re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123}
-}
-"""Basic and reusable regular expressions."""
-
"""
AUXILIARY GLOBAL FUNCTIONS
@@ -163,11 +145,13 @@ def isBlockLevel(tag):
"""Check if the tag is a block level HTML tag."""
return BLOCK_LEVEL_ELEMENTS.match(tag)
+ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123}
+
def handleAttributes(text, parent):
"""Set values of an element based on attribute definitions ({@id=123})."""
def attributeCallback(match):
parent.set(match.group(1), match.group(2))
- return CORE_RE['attr'].sub(attributeCallback, text)
+ return ATTR_RE.sub(attributeCallback, text)
def dequote(string):
"""Remove quotes from around a string."""
@@ -211,369 +195,286 @@ inline elements such as **bold** or *italics*, but rather just catches blocks,
lists, quotes, etc.
"""
-class MarkdownParser:
- """Parser Markdown into a ElementTree."""
+class BlockProcessor:
+ """ Base class for block processors. """
+ def __init__(self, parser=None):
+ self.parser = parser
- def __init__(self):
- pass
+ def lastChild(self, parent):
+ """ Return the last child of an etree element. """
+ if len(parent):
+ return parent[-1]
+ else:
+ return None
- def parseDocument(self, lines):
- """Parse a markdown string into an ElementTree."""
- # Create a ElementTree from the lines
- root = etree.Element("div")
- buffer = []
+ def detab(self, text):
+ """ Remove a tab from the front of each line of the given text. """
+ newtext = []
+ lines = text.split('\n')
for line in lines:
- if line.startswith("#"):
- self.parseChunk(root, buffer)
- buffer = [line]
+ if line.startswith(' '*4):
+ newtext.append(line[4:])
+ elif not line.strip():
+ newtext.append('')
else:
- buffer.append(line)
-
- self.parseChunk(root, buffer)
-
- return etree.ElementTree(root)
+ break
+ return '\n'.join(newtext), '\n'.join(lines[len(newtext):])
- def parseChunk(self, parent_elem, lines, inList=0, looseList=0):
- """Process a chunk of markdown-formatted text and attach the parse to
- an ElementTree node.
+ def looseDetab(self, text):
+ """ Remove a tab from front of lines but allowing dedented lines. """
+ lines = text.split('\n')
+ for i in range(len(lines)):
+ if lines[i].startswith(' '*4):
+ lines[i] = lines[i][4:]
+ return '\n'.join(lines)
- Process a section of a source document, looking for high
- level structural elements like lists, block quotes, code
- segments, html blocks, etc. Some those then get stripped
- of their high level markup (e.g. get unindented) and the
- lower-level markup is processed recursively.
+ def test(self, parent, block):
+ """ Return boolean. Must be overriden by subclasses. """
+ pass
- Keyword arguments:
+ def run(self, parent, blocks):
+ """ Run processor. Must be overridden by subclasses. """
- * parent_elem: The ElementTree element to which the content will be
- added.
- * lines: a list of lines
- * inList: a level
- Returns: None
+class ListIndentProcessor(BlockProcessor):
+ """ Process children of list items. """
- """
- # Loop through lines until none left.
- while lines:
- # Skipping empty line
- if not lines[0]:
- lines = lines[1:]
- continue
+ def test(self, parent, block):
+ return block.startswith(' '*4) and parent[-1] and \
+ (parent[-1].tag == "ul" or parent[-1].tag == "ol")
- # Check if this section starts with a list, a blockquote or
- # a code block. If so, process them.
- processFn = { 'ul': self.__processUList,
- 'ol': self.__processOList,
- 'quoted': self.__processQuote,
- 'tabbed': self.__processCodeBlock}
- for regexp in ['ul', 'ol', 'quoted', 'tabbed']:
- m = CORE_RE[regexp].match(lines[0])
- if m:
- processFn[regexp](parent_elem, lines, inList)
- return
-
- # We are NOT looking at one of the high-level structures like
- # lists or blockquotes. So, it's just a regular paragraph
- # (though perhaps nested inside a list or something else). If
- # we are NOT inside a list, we just need to look for a blank
- # line to find the end of the block. If we ARE inside a
- # list, however, we need to consider that a sublist does not
- # need to be separated by a blank line. Rather, the following
- # markup is legal:
- #
- # * The top level list item
- #
- # Another paragraph of the list. This is where we are now.
- # * Underneath we might have a sublist.
- #
-
- if inList:
- start, lines = self.__linesUntil(lines, (lambda line:
- CORE_RE['ul'].match(line)
- or CORE_RE['ol'].match(line)
- or not line.strip()))
- self.parseChunk(parent_elem, start, inList-1,
- looseList=looseList)
- inList = inList-1
-
- else: # Ok, so it's just a simple block
- test = lambda line: not line.strip() or line[0] == '>'
- paragraph, lines = self.__linesUntil(lines, test)
- if len(paragraph) and paragraph[0].startswith('#'):
- self.__processHeader(parent_elem, paragraph)
- elif len(paragraph) and CORE_RE["isline3"].match(paragraph[0]):
- self.__processHR(parent_elem)
- lines = paragraph[1:] + lines
- elif paragraph:
- self.__processParagraph(parent_elem, paragraph,
- inList, looseList)
-
- if lines and not lines[0].strip():
- lines = lines[1:] # skip the first (blank) line
-
- def __processHR(self, parentElem):
- hr = etree.SubElement(parentElem, "hr")
-
- def __processHeader(self, parentElem, paragraph):
- m = CORE_RE['header'].match(paragraph[0])
- if m:
- level = len(m.group(1))
- h = etree.SubElement(parentElem, "h%d" % level)
- h.text = m.group(2).strip()
+ def run(self, parent, blocks):
+ block = blocks.pop(0)
+ sibling = self.lastChild(parent)
+ if len(sibling) and sibling[-1].tag == 'li':
+ self.parser.parseBlocks(sibling[-1], [self.looseDetab(block)])
else:
- message(CRITICAL, "We've got a problem header!")
+ li = etree.SubElement(sibling, 'li')
+ self.parser.parseBlocks(li, [self.looseDetab(block)])
- def __processParagraph(self, parentElem, paragraph, inList, looseList):
- if ( parentElem.tag == 'li'
- and not (looseList or parentElem.getchildren())):
+class CodeBlockProcessor(BlockProcessor):
+ """ Process code blocks. """
- # If this is the first paragraph inside "li", don't
- # put <p> around it - append the paragraph bits directly
- # onto parentElem
- el = parentElem
+ def test(self, parent, block):
+ return block.startswith(' '*4)
+
+ def run(self, parent, blocks):
+ sibling = self.lastChild(parent)
+ block = blocks.pop(0)
+ theRest = ''
+ if sibling and sibling.tag == "pre" and len(sibling) \
+ and sibling[0].tag == "code":
+ code = sibling[0]
+ block, theRest = self.detab(block)
+ code.text = '%s\n%s\n' % (code.text, block.rstrip())
else:
- # Otherwise make a "p" element
- el = etree.SubElement(parentElem, "p")
-
- dump = []
-
- # Searching for hr or header
- for line in paragraph:
- # it's hr
- if CORE_RE["isline3"].match(line):
- el.text = "\n".join(dump)
- self.__processHR(el)
- dump = []
- # it's header
- elif line.startswith("#"):
- el.text = "\n".join(dump)
- self.__processHeader(parentElem, [line])
- dump = []
- else:
- dump.append(line)
- if dump:
- text = "\n".join(dump)
- el.text = text
-
- def __processUList(self, parentElem, lines, inList):
- self.__processList(parentElem, lines, inList, listexpr='ul', tag='ul')
-
- def __processOList(self, parentElem, lines, inList):
- self.__processList(parentElem, lines, inList, listexpr='ol', tag='ol')
-
- def __processList(self, parentElem, lines, inList, listexpr, tag):
- """
- Given a list of document lines starting with a list item,
- finds the end of the list, breaks it up, and recursively
- processes each list item and the remainder of the text file.
-
- Keyword arguments:
-
- * parentElem: A ElementTree element to which the content will be added
- * lines: a list of lines
- * inList: a level
+ pre = etree.SubElement(parent, 'pre')
+ code = etree.SubElement(pre, 'code')
+ block, theRest = self.detab(block)
+ code.text = '%s\n' % block.rstrip()
+ if theRest:
+ blocks.insert(0, theRest)
- Returns: None
- """
- ul = etree.SubElement(parentElem, tag) # ul might actually be '<ol>'
-
- looseList = 0
-
- # Make a list of list items
- items = []
- item = -1
+class BlockQuoteProcessor(BlockProcessor):
- i = 0 # a counter to keep track of where we are
- for line in lines:
- loose = 0
- if not line.strip():
- # If we see a blank line, this _might_ be the end of the list
- i += 1
- loose = 1
-
- # Find the next non-blank line
- for j in range(i, len(lines)):
- if lines[j].strip():
- next = lines[j]
- break
- else:
- # There is no more text => end of the list
- break
+ RE = re.compile(r'^[ ]{0,3}>[ ](.*)')
- # Check if the next non-blank line is still a part of the list
+ def test(self, parent, block):
+ return bool(self.RE.match(block))
- if ( CORE_RE[listexpr].match(next) or
- CORE_RE['tabbed'].match(next) ):
- # get rid of any white space in the line
- items[item].append(line.strip())
- looseList = loose or looseList
- continue
- else:
- break # found end of the list
-
- # Now we need to detect list items (at the current level)
- # while also detabing child elements if necessary
-
- for expr in ['ul', 'ol', 'tabbed']:
- m = CORE_RE[expr].match(line)
- if m:
- if expr in ['ul', 'ol']: # We are looking at a new item
- #if m.group(1) :
- # Removed the check to allow for a blank line
- # at the beginning of the list item
- items.append([m.group(1)])
- item += 1
- elif expr == 'tabbed': # This line needs to be detabbed
- items[item].append(m.group(4)) #after the 'tab'
- i += 1
- break
- else:
- items[item].append(line) # Just regular continuation
- i += 1 # added on 2006.02.25
+ def run(self, parent, blocks):
+ block = '\n'.join([self.clean(line) for line in
+ blocks.pop(0).split('\n')])
+ sibling = self.lastChild(parent)
+ if sibling and sibling.tag == "blockquote":
+ quote = sibling
else:
- i += 1
-
- # Add the ElementTree elements
- for item in items:
- li = etree.SubElement(ul, "li")
- self.parseChunk(li, item, inList + 1, looseList = looseList)
+ quote = etree.SubElement(parent, 'blockquote')
+ self.parser.parseBlocks(quote, [block])
- # Process the remaining part of the section
- self.parseChunk(parentElem, lines[i:], inList)
-
- def __linesUntil(self, lines, condition):
- """
- A utility function to break a list of lines upon the
- first line that satisfied a condition. The condition
- argument should be a predicate function.
-
- """
- i = -1
- for line in lines:
- i += 1
- if condition(line):
- break
+ def clean(self, line):
+ """ Remove ``>`` from begining of a line. """
+ m = self.RE.match(line)
+ if m:
+ return m.group(1)
+ elif line.strip() == ">":
+ return ""
+ else:
+ return line
+
+class OListProcessor(BlockProcessor):
+ """ Process ordered list blocks. """
+
+ TAG = 'ol'
+ RE = re.compile(r'^[ ]{0,3}\d+\.[ ](.*)')
+
+ def test(self, parent, block):
+ return bool(self.RE.match(block))
+
+ def run(self, parent, blocks):
+ items = self.get_items(blocks.pop(0))
+ sibling = self.lastChild(parent)
+ if sibling and sibling.tag == self.TAG:
+ lst = sibling
+ # make sure previous item is in a p.
+ if len(lst) and lst[-1].text and not len(lst[-1]):
+ p = etree.SubElement(lst[-1], 'p')
+ p.text = lst[-1].text
+ lst[-1].text = ''
+ # parse first block differently as it gets wrapped in a p.
+ li = etree.SubElement(lst, 'li')
+ self.parser.state = 'looselist'
+ firstitem = items.pop(0)
+ self.parser.parseBlocks(li, [firstitem])
+ self.parser.resetState()
else:
- i += 1
- return lines[:i], lines[i:]
+ lst = etree.SubElement(parent, self.TAG)
+ self.parser.state = 'list'
+ for item in items:
+ li = etree.SubElement(lst, 'li')
+ self.parser.parseBlocks(li, [item])
+ self.parser.resetState()
- def __processQuote(self, parentElem, lines, inList):
- """
- Given a list of document lines starting with a quote finds
- the end of the quote, unindents it and recursively
- processes the body of the quote and the remainder of the
- text file.
+ def get_items(self, block):
+ """ Break a block into list items. """
+ items = []
+ for line in block.split('\n'):
+ m = self.RE.match(line)
+ if m:
+ items.append(m.group(1))
+ else:
+ items[-1] = '\n'.join([items[-1], line])
+ return items
- Keyword arguments:
- * parentElem: ElementTree element to which the content will be added
- * lines: a list of lines
- * inList: a level
+class UListProcessor(OListProcessor):
+ """ Process unordered list blocks. """
- Returns: None
+ TAG = 'ul'
+ RE = re.compile(r'^[ ]{0,3}[*+-][ ](.*)')
- """
- dequoted = []
- i = 0
- blank_line = False # allow one blank line between paragraphs
- for line in lines:
- m = CORE_RE['quoted'].match(line)
- if m:
- dequoted.append(m.group(1))
- i += 1
- blank_line = False
- elif not blank_line and line.strip() != '':
- dequoted.append(line)
- i += 1
- elif not blank_line and line.strip() == '':
- dequoted.append(line)
- i += 1
- blank_line = True
- else:
- break
- blockquote = etree.SubElement(parentElem, "blockquote")
+class HashHeaderProcessor(BlockProcessor):
+ """ Process Hash Headers. """
- self.parseChunk(blockquote, dequoted, inList)
- self.parseChunk(parentElem, lines[i:], inList)
+ RE = re.compile(r'^(#{1,6})(.*?)#*$')
- def __processCodeBlock(self, parentElem, lines, inList):
- """
- Given a list of document lines starting with a code block
- finds the end of the block, puts it into the ElementTree verbatim
- wrapped in ("<pre><code>") and recursively processes the
- the remainder of the text file.
+ def test(self, parent, block):
+ return block.startswith('#')
- Keyword arguments:
+ def run(self, parent, blocks):
+ lines = blocks.pop(0).split('\n')
+ line1 = lines.pop(0)
+ m = self.RE.match(line1)
+ if m:
+ h = etree.SubElement(parent, 'h%d' % len(m.group(1)))
+ h.text = m.group(2).strip()
+ else:
+ lines.insert(0, line1)
+ if len(lines):
+ blocks.insert(0, '\n'.join(lines))
- * parentElem: ElementTree element to which the content will be added
- * lines: a list of lines
- * inList: a level
- Returns: None
+class SHeaderProcessor(BlockProcessor):
+ """ Process Setext-style Headers. """
- """
- detabbed, theRest = self.detectTabbed(lines)
- pre = etree.SubElement(parentElem, "pre")
- code = etree.SubElement(pre, "code")
- text = "\n".join(detabbed).rstrip()+"\n"
- code.text = AtomicString(text)
- self.parseChunk(parentElem, theRest, inList)
+ RE = re.compile(r'^.*?\n[=-]{3,}', re.MULTILINE)
- def detectTabbed(self, lines):
- """ Find indented text and remove indent before further proccesing.
+ def test(self, parent, block):
+ return bool(self.RE.match(block))
- Keyword arguments:
+ def run(self, parent, blocks):
+ lines = blocks.pop(0).split('\n')
+ if lines[1].startswith('='):
+ level = 1
+ else:
+ level = 2
+ h = etree.SubElement(parent, 'h%d' % level)
+ h.text = lines[0].strip()
+ if len(lines) > 2:
+ blocks.insert(0, '\n'.join(lines[2:]))
- * lines: an array of strings
- * fn: a function that returns a substring of a string
- if the string matches the necessary criteria
- Returns: a list of post processes items and the unused
- remainder of the original list
+class HRProcessor(BlockProcessor):
+ """ Process Horizontal Rules. """
- """
- items = []
- item = -1
- i = 0 # to keep track of where we are
+ RE = re.compile(r'([*_-][ ]?){3,}')
- def detab(line):
- match = CORE_RE['tabbed'].match(line)
- if match:
- return match.group(4)
+ def test(self, parent, block):
+ return bool(self.RE.search(block))
+ def run(self, parent, blocks):
+ # Check for lines in block before hr.
+ lines = blocks.pop(0).split('\n')
+ prelines = []
for line in lines:
- if line.strip(): # Non-blank line
- line = detab(line)
- if line:
- items.append(line)
- i += 1
- continue
- else:
- return items, lines[i:]
+ m = self.RE.match(line)
+ if m:
+ break
+ else:
+ prelines.append(line)
+ if len(prelines):
+ self.parser.parseBlocks(parent, ['\n'.join(prelines)])
+ # create hr
+ hr = etree.SubElement(parent, 'hr')
+ # check for lines in block after hr.
+ lines = lines[len(prelines)+1:]
+ if len(lines):
+ blocks.insert(0, '\n'.join(lines))
+
+
+class PBlockProcessor(BlockProcessor):
+ """ Process Paragraph blocks. """
+
+ def test(self, parent, block):
+ return True
+
+ def run(self, parent, blocks):
+ block = blocks.pop(0)
+ if block.strip():
+ if self.parser.state == 'list':
+ parent.text = block
+ else:
+ p = etree.SubElement(parent, 'p')
+ p.text = block
- else: # Blank line: _maybe_ we are done.
- i += 1 # advance
- # Find the next non-blank line
- for j in range(i, len(lines)):
- if lines[j].strip():
- next_line = lines[j]; break
- else:
- break # There is no more text; we are done.
+class BlockParser:
+ """ Parse Markdown blocks into an ElementTree object. """
- # Check if the next non-blank line is tabbed
- if detab(next_line): # Yes, more work to do.
- items.append("")
- continue
- else:
- break # No, we are done.
- else:
- i += 1
+ def __init__(self):
+ self.blockprocessors = OrderedDict()
+ self.blockprocessors['indent'] = ListIndentProcessor(self)
+ self.blockprocessors['code'] = CodeBlockProcessor(self)
+ self.blockprocessors['hashheader'] = HashHeaderProcessor(self)
+ self.blockprocessors['sheader'] = SHeaderProcessor(self)
+ self.blockprocessors['hr'] = HRProcessor(self)
+ self.blockprocessors['olist'] = OListProcessor(self)
+ self.blockprocessors['ulist'] = UListProcessor(self)
+ self.blockprocessors['quote'] = BlockQuoteProcessor(self)
+ self.blockprocessors['paragraph'] = PBlockProcessor(self)
+ self.resetState()
+
+ def resetState(self):
+ self.state = ''
- return items, lines[i:]
+ def parseDocument(self, lines):
+ """ Parse a markdown string into an ElementTree. """
+ # Create a ElementTree from the lines
+ root = etree.Element("div")
+ blocks = '\n'.join(lines).split('\n\n')
+ self.parseBlocks(root, blocks)
+ return etree.ElementTree(root)
+
+ def parseBlocks(self, parent, blocks):
+ """ Process blocks of markdown text and attach to given etree node. """
+ while blocks:
+ for processor in self.blockprocessors.values():
+ if processor.test(parent, blocks[0]):
+ processor.run(parent, blocks)
+ break
"""
@@ -725,75 +626,15 @@ class HtmlBlockPreprocessor(Preprocessor):
return new_text.split("\n")
-class HeaderPreprocessor(Preprocessor):
-
- """Replace underlined headers with hashed headers.
-
- (To avoid the need for lookahead later.)
-
- """
-
- def run (self, lines):
- i = -1
- while i+1 < len(lines):
- i = i+1
- if not lines[i].strip():
- continue
-
- if lines[i].startswith("#"):
- lines.insert(i+1, "\n")
-
- if (i+1 <= len(lines)
- and lines[i+1]
- and lines[i+1][0] in ['-', '=']):
-
- underline = lines[i+1].strip()
-
- if underline == "="*len(underline):
- lines[i] = "# " + lines[i].strip()
- lines[i+1] = ""
- elif underline == "-"*len(underline):
- lines[i] = "## " + lines[i].strip()
- lines[i+1] = ""
-
- return lines
-
-
-class LinePreprocessor(Preprocessor):
- """Convert HR lines to "___" format."""
- blockquote_re = re.compile(r'^(> )+')
-
- def run (self, lines):
- for i in range(len(lines)):
- prefix = ''
- m = self.blockquote_re.search(lines[i])
- if m:
- prefix = m.group(0)
- if self._isLine(lines[i][len(prefix):]):
- lines[i] = prefix + "___"
- return lines
-
- def _isLine(self, block):
- """Determine if a block should be replaced with an <HR>"""
- if block.startswith(" "):
- return False # a code block
- text = "".join([x for x in block if not x.isspace()])
- if len(text) <= 2:
- return False
- for pattern in ['isline1', 'isline2', 'isline3']:
- m = CORE_RE[pattern].match(text)
- if (m and m.group(1)):
- return True
- else:
- return False
+class ReferencePreprocessor(Preprocessor):
+ """ Remove reference definitions from text and store for later use. """
+ RE = re.compile(r'^(\ ?\ ?\ ?)\[([^\]]*)\]:\s*([^ ]*)(.*)$', re.DOTALL)
-class ReferencePreprocessor(Preprocessor):
- """Remove reference definitions from the text and store them for later use."""
def run (self, lines):
new_text = [];
for line in lines:
- m = CORE_RE['reference-def'].match(line)
+ m = self.RE.match(line)
if m:
id = m.group(2).strip().lower()
t = m.group(4).strip() # potential title
@@ -1776,7 +1617,7 @@ class Markdown:
* safe_mode: Disallow raw html. One of "remove", "replace" or "escape".
"""
- self.parser = MarkdownParser()
+ self.parser = BlockParser()
self.safeMode = safe_mode
self.registeredExtensions = []
self.docType = ""
@@ -1784,8 +1625,6 @@ class Markdown:
self.preprocessors = OrderedDict()
self.preprocessors["html_block"] = HtmlBlockPreprocessor(self)
- self.preprocessors["header"] = HeaderPreprocessor(self)
- self.preprocessors["line"] = LinePreprocessor(self)
self.preprocessors["reference"] = ReferencePreprocessor(self)
# footnote preprocessor will be inserted with "<reference"
350'>1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305