Lines Matching full:content
11 def fixBullets(content): argument
13 content = re.sub(r'-\s{3}', '- ', content)
15 content = re.sub(r'(\d+\.)\s{2}', r'\1 ', content)
19 for line in content.splitlines():
34 def fixTitles(content): argument
45 processed_content = re.sub(pattern, replaceUnwanted, content)
49 def addHeaderAndFooter(content): argument
51 title_match = re.search(r'(?<=#\s).*', content)
63 title_exists = re.search(r'^---\n.*title:.*\n---', content, re.MULTILINE)
64 footer_exists = footer.strip() in content
68 content = header + content
72 content = content + footer
74 return content
77 def fixIndentedBullets(content): argument
82 lines = content.split('\n')
108 def removeRedundantLinks(content): argument
117 processed_content = re.sub(link_pattern, replace_link, content)
142 def process_links(content): argument
153 return pattern.sub(replace_link, content)
158 content = file.read() # Read entire file as a string
159 content = addHeaderAndFooter(content)
160 content = fixTitles(content)
161 content = fixBullets(content)
162 content = removeRedundantLinks(content)
163 content = fixIndentedBullets(content)
164 content = process_links(content)
166 file.write(content)
170 content = addHeaderAndFooter(str)
171 content = fixTitles(content)
172 content = fixBullets(content)
173 content = removeRedundantLinks(content)
174 content = fixIndentedBullets(content)
175 content = process_links(content)
176 return content