File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
streamer/r2-streamer-swift/Parser/EPUB/Resource Transformers Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -61,20 +61,11 @@ final class EPUBHTMLInjector {
6161 }
6262 }
6363
64- if let headStart = content. endIndex ( of: " <head> " ) {
65- let headInjection : String
66- if isReflowable {
67- headInjection = """
68- <meta name= " viewport " content= " width=device-width, height=device-height, initial-scale=1.0; " />
69- <style type= " text/css " >@font-face{font-family: " OpenDyslexic " ; src:url( " /fonts/OpenDyslexic-Regular.otf " ) format( " opentype " );}</style>
70- <script type= " text/javascript " src= " /r2-navigator/epub/scripts/readium-reflowable.js " ></script>
71- """
72- } else {
73- headInjection = """
74- <script type= " text/javascript " src= " /r2-navigator/epub/scripts/readium-fixed.js " ></script>
75- """
76- }
77- content = content. insert ( string: headInjection, at: headStart)
64+ if isReflowable, let headStart = content. endIndex ( of: " <head> " ) {
65+ content = content. insert ( string: """
66+ <meta name= " viewport " content= " width=device-width, height=device-height, initial-scale=1.0; " />
67+ <style type= " text/css " >@font-face{font-family: " OpenDyslexic " ; src:url( " /fonts/OpenDyslexic-Regular.otf " ) format( " opentype " );}</style>
68+ """ , at: headStart)
7869 }
7970
8071 return content
You can’t perform that action at this time.
0 commit comments