I'm trying to figure out why pythons' format
OUTPUT_HTML_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'formats',
'html')
with open(os.path.join(OUTPUT_HTML_PATH, 'index.html'), 'r') as f:
OUTPUT_HTML_PAGE = f.read()
OUTPUT_HTML_PAGE.format(feedback_json=json.dumps(
feedback, indent=2, sort_keys=True),
resources_path=args.resources_path)
The format
succeeded in case of the old index.html
.
Once I've tried to change the index.html
with adding a script tag like so:
<script type="application/javascript">
function loadScript(url, callback){
a=1
}
</script>
I'm getting
KeyError: '\n a=1\n '
My function was simplified to reduce complexity