Skip to content

Commit

Permalink
indentation for html
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmueller committed Jul 10, 2019
1 parent 6fae8d9 commit da15da2
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions memorize.ai/Global.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,33 @@ extension WKWebView {
func render(_ text: String, fontSize: Int, textColor: String = "000", backgroundColor: String = "fff") {
let escapedText = Card.escape(text)
loadHTMLString("""
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="katex.min.css">
<script src="katex.min.js"></script>
<script src="auto-render.min.js"></script>
<link rel="stylesheet" href="prism.css">
<style>
html,
body {
font-family: Helvetica;
font-size: \(fontSize / (Device.allPads.contains(CURRENT_DEVICE) ? 2 : 1))px;
color: #\(textColor);
background-color: #\(backgroundColor);
}
img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<div>\((try? Down(markdownString: escapedText).toHTML()) ?? escapedText)</div>
<script>renderMathInElement(document.body)</script>
<script src="prism.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="katex.min.css">
<script src="katex.min.js"></script>
<script src="auto-render.min.js"></script>
<link rel="stylesheet" href="prism.css">
<style>
html,
body {
font-family: Helvetica;
font-size: \(fontSize / (Device.allPads.contains(CURRENT_DEVICE) ? 2 : 1))px;
color: #\(textColor);
background-color: #\(backgroundColor);
}
img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<div>\((try? Down(markdownString: escapedText).toHTML()) ?? escapedText)</div>
<script>renderMathInElement(document.body)</script>
<script src="prism.js"></script>
</body>
</html>
""", baseURL: URL(fileURLWithPath: Bundle.main.bundlePath, isDirectory: true))
}
}
Expand Down

0 comments on commit da15da2

Please sign in to comment.