There was an error while loading. Please reload this page.
1 parent 3c69dc6 commit 1a1a453Copy full SHA for 1a1a453
1 file changed
pelican/tools/pelican_import.py
@@ -1084,8 +1084,12 @@ def fields2pelican(
1084
content = content.replace("\\\n ", " \n")
1085
content = content.replace("\\\n", " \n")
1086
1087
- if wp_attach and links:
1088
- content = update_links_to_attached_files(content, links)
+ # Convert SyntaxHighlighter format code blocks
+ brush_pattern = re.compile(r'^`{3}\s*brush:\s*([a-zA-Z0-9_+\-#]+)', re.MULTILINE)
1089
+ content = brush_pattern.sub(r'```\1', content)
1090
+
1091
+ if wp_attach and links:
1092
+ content = update_links_to_attached_files(content, links)
1093
1094
with open(out_filename, "w", encoding="utf-8") as fs:
1095
fs.write(header + content)
@@ -1265,5 +1269,8 @@ def main():
1265
1269
filter_author=args.author,
1266
1270
wp_custpost=args.wp_custpost or False,
1267
1271
wp_attach=args.wp_attach or False,
1268
- attachments=attachments or None,
1272
+ attachments=attachments or None
1273
)
1274
1275
+if __name__ == "__main__":
1276
+ main()
0 commit comments