Conversation
- Replace CDN links with bundled KaTeX CSS, JS, and fonts (base64-embedded) via a generate-katex-assets script — package now works fully offline - Add katex as a devDependency for asset generation - Update README with honest use-case guidance: when to use this package (Expo managed, Old Architecture, zero native modules) and when to use better-suited alternatives (enriched-markdown, nitro-markdown) - Fix ESLint flat config to declare Node.js globals for scripts/ directory Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.md">
<violation number="1" location="README.md:97">
P2: Use a number for `borderWidth` in the React Native example; string values are invalid for this style prop.</violation>
</file>
<file name="src/katex.tsx">
<violation number="1" location="src/katex.tsx:319">
P2: Default style fallbacks are never applied because invalid/omitted style input returns `{}` instead of the initialized defaults.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| containerStyle={{ | ||
| width: '100%', | ||
| backgroundColor: 'yellow', | ||
| borderWidth: '1', |
There was a problem hiding this comment.
P2: Use a number for borderWidth in the React Native example; string values are invalid for this style prop.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 97:
<comment>Use a number for `borderWidth` in the React Native example; string values are invalid for this style prop.</comment>
<file context>
@@ -69,6 +94,8 @@ export default function HomeScreen() {
containerStyle={{
width: '100%',
backgroundColor: 'yellow',
+ borderWidth: '1',
+ borderColor: 'orange',
}}
</file context>
Suggested change
| borderWidth: '1', | |
| borderWidth: 1, |
| }; | ||
|
|
||
| if (!s || typeof s !== 'object' || Array.isArray(s)) { | ||
| return {}; |
There was a problem hiding this comment.
P2: Default style fallbacks are never applied because invalid/omitted style input returns {} instead of the initialized defaults.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/katex.tsx, line 319:
<comment>Default style fallbacks are never applied because invalid/omitted style input returns `{}` instead of the initialized defaults.</comment>
<file context>
@@ -1,119 +1,347 @@
+ };
+
+ if (!s || typeof s !== 'object' || Array.isArray(s)) {
+ return {};
+ }
+
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Katex assets are bundled for offline support, CI fixes, CD addition for automated deployment
Summary by cubic
Bundle KaTeX CSS/JS/fonts into the package and render via a pure
react-native-webview, enabling fully offline LaTeX with auto-height. Switch CI toyarnand add tag-based CD for npm publishing; update docs and lint config.New Features
scripts/generate-katex-assets.js(src/katex-assets.ts) so no network is required.src/katex.tsxand exportKaTeXAutoHeightWebViewandcreateKaTeXHTML.Refactors
@formidable-webview/webshell; addkatexas a dev dependency and agenerate-assetsscript; update README and ESLint for Node globals inscripts/.yarncache/install, run CI ondevelop, addcd.ymlto publish onv*tags; setrelease-itto not publish (handled by CD).Written for commit 5d70738. Summary will update on new commits.