浏览代码

fix(mobile): katex render

charlie 4 月之前
父节点
当前提交
edbd03f321
共有 3 个文件被更改,包括 13 次插入1 次删除
  1. 2 0
      gulpfile.js
  2. 10 0
      src/main/capacitor/components/app.css
  3. 1 1
      src/main/frontend/config.cljs

+ 2 - 0
gulpfile.js

@@ -115,6 +115,8 @@ const common = {
         'node_modules/katex/dist/fonts/*.woff2',
       ]).pipe(gulp.dest(path.join(outputPath, 'css', 'fonts'))),
       () => gulp.src([
+        'node_modules/katex/dist/katex.min.js',
+        'node_modules/katex/dist/contrib/mhchem.min.js',
         'node_modules/marked/marked.min.js',
         'node_modules/@highlightjs/cdn-assets/highlight.min.js',
         'node_modules/@isomorphic-git/lightning-fs/dist/lightning-fs.min.js',

+ 10 - 0
src/main/capacitor/components/app.css

@@ -146,6 +146,16 @@ ion-content {
   }
 }
 
+.latex.initial {
+  @apply pt-1;
+
+  .katex-html {
+    &[aria-hidden="true"] {
+      @apply hidden;
+    }
+  }
+}
+
 [type='text']:focus, [type='email']:focus, [type='url']:focus,
 [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus,
 [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus,

+ 1 - 1
src/main/frontend/config.cljs

@@ -106,7 +106,7 @@
     publishing?
     path
 
-    (util/file-protocol?)
+    (or (util/file-protocol?) (util/capacitor-new?))
     (string/replace path "/static/" "./")
 
     :else