Skip to content
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

Inter-operation issue with Fast Text Color plugin #75

Open
hansbobby opened this issue Oct 2, 2024 · 0 comments
Open

Inter-operation issue with Fast Text Color plugin #75

hansbobby opened this issue Oct 2, 2024 · 0 comments

Comments

@hansbobby
Copy link

hansbobby commented Oct 2, 2024

Fast Text Color uses ={color} and = as markers, and this does not work well with Sheets Extended (obsidan-advanced-table-xt).

Is it possible to constrain the allowed adjacent characters, e.g., prevent the following char being =?

Here are some samples to test with.


#### Native Table
```
| th                        |
| ------------------------- |
| td normal                 |
| ~={red}td red=~           |
| td ~={green}green=~       |
| ~={blue}td=~ blue         |
| td ~={cyan}cyan=~ middle  |
```

#### Live Preview Native Table
| th                        |
| ------------------------- |
| td normal                 |
| ~={red}td red=~           |
| td ~={green}green=~       |
| ~={blue}td=~ blue         |
| td ~={cyan}cyan=~ middle  |

#### Rendering

![[#Live Preview Native Table]]

---

#### Native Table with Escape
```
| th                        |
| ------------------------- |
| td normal                 |
| \~={red}td red=~          |
| td \~={green}green=~      |
| \~={blue}td=~ blue        |
| td \~={cyan}cyan=~ middle |
```

#### Live Preview Native Table with Escape
| th                        |
| ------------------------- |
| td normal                 |
| \~={red}td red=~          |
| td \~={green}green=~      |
| \~={blue}td=~ blue        |
| td \~={cyan}cyan=~ middle |

#### Rendering

![[#Live Preview Native Table with Escape]]

---
#### Sheet Language Tag
```
~~~sheet
| th                        |
| ------------------------- |
| td normal                 |
| ~={red}td red=~           |
| td ~={green}green=~       |
| ~={blue}td=~ blue         |
| td ~={cyan}cyan=~ middle  |
~~~
```

#### Live Preview Sheet Language Tag
~~~sheet
| th                        |
| ------------------------- |
| td normal                 |
| ~={red}td red=~           |
| td ~={green}green=~       |
| ~={blue}td=~ blue         |
| td ~={cyan}cyan=~ middle  |
~~~

#### Rendering

![[#Live Preview Sheet Language Tag]]

---
#### Sheet Language Tag with Escape
```
~~~sheet
| th                        |
| ------------------------- |
| td normal                 |
| \~={red}td red=~          |
| td \~={green}green=~      |
| \~={blue}td=~ blue        |
| td \~={cyan}cyan=~ middle |
~~~
```

#### Live Preview Sheet Language Tag with Escape
~~~sheet
| th                        |
| ------------------------- |
| td normal                 |
| \~={red}td red=~          |
| td \~={green}green=~      |
| \~={blue}td=~ blue        |
| td \~={cyan}cyan=~ middle |
~~~

#### Rendering

![[#Live Preview Sheet Language Tag with Escape]]

---

For example, in the 2nd section, where escape is added as follows

| th                        |
| ------------------------- |
| td normal                 |
| \~={red}td red=~          |
| td \~={green}green=~      |
| \~={blue}td=~ blue        |
| td \~={cyan}cyan=~ middle |

We can find that Live Preview is still missing several cells/content.

live-preview-escape-not-effective

If we can prevent parsing =, maybe they could work together.
For example, changing the regular expression as follows:

- (?<![\\~])~(?!~)
+ (?<![\\~=])~(?=\s*[.{])

In the lookbehind (first half), adding = along with tilde and backslash.
In the lookahead (second half), change it to positive lookahead and only accepts dot or left-brace.

Would this be feasible?

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

No branches or pull requests

1 participant