Skip to content

Some Markdown fixes and additions.#658

Open
not-jakob wants to merge 2 commits into
focus-editor:mainfrom
not-jakob:main
Open

Some Markdown fixes and additions.#658
not-jakob wants to merge 2 commits into
focus-editor:mainfrom
not-jakob:main

Conversation

@not-jakob
Copy link
Copy Markdown

Added escape character .
Added alerts.
Added [x] with a small x for task higlighting.
Improved square bracket highlighting when using repeated square brackets.

Added escape character .
Added alerts.
Added [x] with a small x for task higlighting.
Improved square bracket highlighting when using repeated square brackets.
Copy link
Copy Markdown
Collaborator

@obiwanus obiwanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you also add a test document to the preview which demonstrates the new additions

Comment thread src/langs/markdown.jai
} else if is_digit(char) {
parse_number(tokenizer, *token);
} else {
did_not_found_char := false;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
did_not_found_char := false;
did_not_find_char := false;

Comment thread src/langs/markdown.jai
case #char "<"; parse_less_than(tokenizer, *token);
case #char "\\"; token.type = .default; t += 2;
case;
did_not_found_char = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
did_not_found_char = true;
did_not_find_char = true;

Comment thread src/langs/markdown.jai
}

// Only after any whitespace.
if did_not_found_char && found_whitespace {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if did_not_found_char && found_whitespace {
if did_not_find_char && found_whitespace {

Comment thread src/langs/markdown.jai
t += 1;
identifier_str := read_identifier_string_tmp(tokenizer, stop_at_char = #char "\n", stop_at_white_space = false);

found_allert := false;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
found_allert := false;
found_alert := false;

Comment thread src/langs/markdown.jai
for alerts {
if begins_with(identifier_str, it.opening_tag) {
token.type = it.type;
found_allert = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
found_allert = true;
found_alert = true;

Comment thread src/langs/markdown.jai
}
}

if !found_allert {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !found_allert {
if !found_alert {

@not-jakob
Copy link
Copy Markdown
Author

Can i add it here?
markdown.md
And sorry again for the typos :/

@obiwanus
Copy link
Copy Markdown
Collaborator

What I meant was extending the markdown sample here: https://github.com/focus-editor/focus/blob/main/src/widgets/color_preview_samples.jai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants