Repository navigation
[Mobile] Comments and markdown rendering - #26
Merged
Merged
Conversation
Closes #8. GFM comes from react-native-marked, except task lists, which it cannot render: its parser drops marked's `task` and `checked` flags before the renderer sees them, so a checklist would come out as bare bullets with no box. The source is lexed at block level here, task lists are drawn directly -- which is also what makes them tappable -- and every other block is handed back to the library by its own raw text. Mentions and TEAMKEY-123 links are resolved in the renderer's text() hook, which only ever receives text tokens. That is what keeps `@demo` inside backticks or a fenced block literal -- the same property the web gets from running this as a remark plugin rather than a regex over the source, and an issue tracker is full of shell snippets. Ticking a checkbox edits the source at that one character rather than re-serialising the parsed markdown, so bullets, indentation and trailing spaces the author chose stay exactly as typed. Verified byte for byte against a live instance. The `@` menu is driven by the caret rather than the last keystroke, so it also opens when you move back into a half-written handle, and stays shut on the second `@` of an email address. An unknown handle stays plain text: far more likely an email fragment or a shell variable than a person. Comments with no author are automation rules, and render as such. One correction on the way: I assumed commenting always starts you watching. It does not -- auto_watch only adds a row when you have never expressed a preference, so unwatching and then answering a question does not resubscribe you. The test now pins that actual contract. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #8.
GFM comes from
react-native-marked, except task lists, which it cannot render: its parser drops marked'stask/checkedflags before the renderer sees them, so a checklist would come out as bare bullets with no box. The source is lexed at block level here, task lists are drawn directly — which is also what makes them tappable — and every other block is handed back to the library by its ownrawtext.Mentions and
TEAMKEY-123links are resolved in the renderer'stext()hook, which only ever receives text tokens. That keeps@demoinside backticks or a fenced block literal — the same property the web gets from a remark plugin rather than a regex over the source, and an issue tracker is full of shell snippets.Ticking a checkbox edits the source at that one character rather than re-serialising the parsed markdown, so bullets, indentation and trailing spaces stay exactly as typed. Verified byte for byte against a live instance.
A correction
I assumed commenting always starts you watching. It does not —
auto_watchonly adds a row when you have never expressed a preference, so unwatching and then answering a question does not resubscribe you. The test now pins that actual contract.