New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] feat: support underline for markdown and update string format pattern #9245
Conversation
99d0084
to
9a5f037
Compare
This reverts commit f85d380.
3b810f8
to
3c38c73
Compare
This commit updates the text formatting functions to use a consistent %s pattern for wrapping text with the appropriate formatting markers. The format-text! function has also been updated to accommodate these changes. - Updated get-bold, get-italic, get-strike-through, get-underline, and get-highlight functions to use %s pattern - Modified format-text! to handle the new %s pattern in the formatting functions - Ensured compatibility with existing text formatting behavior
|
…y and consistency
This reverts commit 3ddff8f.
|
149fa1e
to
c2ed3d6
Compare
c2ed3d6
to
3f2a584
Compare
This reverts commit 1ce4697.
…ogseq#9388) * enhance: only autopair tilda when text is selected * Enhance/editor string formatting e2e (#48) * enhance(E2E): Test editor italic, bold, strikethrough and underline. ... --------- Signed-off-by: Bad3r <bad3r@protonmail.com>
This reverts commit 3ddff8f.
* enhance(E2E): Test editor italic, bold, strikethrough and underline. * disable underline tests until logseq#9245 is merged * Fix: position * enhance: add test with all formatting * enhance: add tests for editor autopairing * enhance: add tests for editor autopairing * add: underline test as fixme as a prereq to logseq#9245 * enhance: break tests into steps * revert: test steps --------- Signed-off-by: Bad3r <bad3r@protonmail.com>
|
083e4a8
to
201ce7b
Compare
ba07fe6
to
824250c
Compare
Humm, seems tons of conflicts given the great changes of the dicts |
824250c
to
286eb76
Compare
Close due to the team not having time to review large community PRs and to save my time. |
Update formatting functions and format-text! to use %s pattern
TODO
util/get-selected-text
Depends on:
breaking change:
/underline
command and replace it withmodKey + u
shortcutissues:
modKey + u
to underline text #9390forum posts:
QA Testing Instructions for Text Formatting Feature
Repeat the steps for markdown and org-mode formats.
Initial Setup:
LOGSEQ: Logical Organization Graphical-System for Efficient Querying.
Test for Text Formatting Features:
Bold:
Graphical
and apply bold formatting ($MOD+b
)**Graphical**|-System
|
) position.Select the styled word
Graphical
again and remove the formatting by pressing the same shortcut.Italic:
Graphical
and apply italic formatting ($MOD+i
)*Graphical*|-System
|
) position.Select the styled word
Graphical
again and remove the formatting by pressing the same shortcut.Underline:
Graphical
and apply underline formatting ($MOD+u
)<u>Graphical</u>|-System
|
) position.Select the styled word
Graphical
again and remove the formatting by pressing the same shortcut.Strikethrough:
Graphical
and apply the strikethrough formatting ($MOD+Shift+s
).~~Graphical~~|-System
|
) position.Select the styled word
Graphical
again and remove the formatting by pressing the same shortcut.Sequential Application and Removal of Formatting:
Graphical
and apply all the text formatting shortcuts. Example:$MOD+i
,$MOD+u
,$MOD+Shift+s
,$MOD+b
.**~~<u>*Graphical*</u>~~**|-System
|
) position.Graphical|-System
(Graphical
should remain selected)Graphical
should remain selected after removing the formatting.Test for Formatting Without Selection:
$MOD+i
,$MOD+u
,$MOD+Shift+s
,$MOD+b
.**~~<u>*|*</u>~~**
Please remember to document any discrepancies between the expected and actual results, along with any error messages or issues encountered during testing.
logseq-string-formatting.mp4
This PR updates the text formatting functions to use a consistent %s pattern for wrapping text with the appropriate formatting markers. The
format-text!
function has also been updated to accommodate these changes.The result of this change is introducing a new feature; underline text using
mod + u
. Since markdown doesn't support underlining, HTML syntax is needed. Due to the opening and closing tags being different for HTML, there was a need to update thetext-format!
function to accommodate this case. Instead of writing a special case for underlines, I opted to modify the existing format used to a more malleable one.Discord: https://discord.com/channels/725182569297215569/735747000649252894/1100463176270745640
This pull request introduces a new feature that adds a keyboard shortcut for underlining text
Mod + u
in both Markdown and Org-mode formats. The implementation modifies theget-underline
function and introduces theunderline-format!
function to support the respective underline syntax for each format. In Org-mode, the underscore (_) syntax is used, while in Markdown, the text is wrapped with the<u>
and</u>
HTML tags.Since Markdown does not natively support underlines, I opted to use HTML tags as a workaround. This presented a challenge as the opening and closing tags are different. Initially, I considered modifying the
format-text!
function to handle this case, but doing so could potentially break other features. As a result, I decided to not change it.This approach may have introduced some code duplication, and there could be a more efficient solution beyond my current understanding of the code. I apologize if this adds extra work to the review process. Please let me know if you have any suggestions for improvements or if further modifications are needed.
All translations have been added and its been added to the shortcuts page.
Video Demo:
composed-grasp-log-topic.mp4
QA Steps:
Test unwrapping