`** in preview mode.
+
+#### 7. NOTE: Delimiter Escaping
As already explained, using escaper backslash can change the semantic meaning to that being escaped. Escaped punctuation is treated as regular character that doesn't have functional use. This applies to those delimiters when "Delimiter escaping" option is switched on.
@@ -100,73 +175,33 @@ However, we can only apply this feature in editor mode, since escaped character
Due to this condition, "Delimiter escaping" was turned of by default to maintain consistency between editor and preview mode.
-### B. Paragraph Aligning
+#### 8. Pandoc-style Fenced Div
-Paragraph can be aligned by inserting one of specific tags exactly at the beginning of the line. Those tags are `!!left!!`, `!!right!!`, `!!center!!`, and `!!justify!!`, where each tag representing a type of alignment that should be used.
+Since the align tag has been removed, as it is not as flexible as though, I decided to bring the plugin with Pandoc-style fenced div, which more flexible and intuitive for block customizing. Even though it is Pandoc-style, the implemented rule in this plugin is more restricted to avoid unnecessary broken layout and conflicts (or even worse).
-Note that any character that was prepended before the tag, even if it's just one space, will terminate the tag, so it's treated as regular characters.
+- Fenced div must be opened by a line consists of three or more colons (`:::`), at must be located exactly in the line start.
+- The colons may, and only, be followed by tag that consists of alphanumeric, hyphen, and space (can be empty).
+- Other characters aren't allowed in the opening line. Even a colon that was inserted in the tag range will make the format invalid.
+- It is only be closed by different context (e.g. list, blockquote), blank line, or the end of the document.
+- You don't need to close the format with any delimiter.
```
-!!center!!will be centered
+:::
+valid fenced div
- !!center!!will not be centered
+::: my-class
+also valid
+
+:::my-class other-class
+also
+valid
```
-It's will be rendered like this:
+#### 9. Context-aware Formatting
->
->
will be centered
->
!!center!!will not be centered
->
+Any syntax that are written in the codespan, codeblock, math, comment, and wikilink don't apply the rules, so they are treated according to their context. Or, in the nutshell, they aren't formatted. This corresponds to the many of markdown implementation, as well as that implemented in Obsidian.
-#### Caution
-
-In editor mode, each line depends on itself, so you must type alignment tag to get it be aligned. However, in preview mode, paragraph can consist more than one line. Accordingly, only tag that located at the first line of the paragraph (if it consists more than a line) will be treated as it is, and the others will act as a regular text.
-
-So, this Markdown
-
-```
-!!center!!aligned to the center in both modes
-!!right!!aligned to the right in editor, to the center in preview
-not being aligned in editor (or aligned to its initial), aligned to center in preview
-```
-
-will be rendered in editor like this:
-> aligned to the center in both modes
-> aligned to the right in editor, to the center in preview
-> not being aligned in editor (or aligned to its initial), aligned to center in preview
-
-and in preview like this:
->
-> aligned to the center in both modes
-> !!right!!aligned to the right in editor, to the center in preview
-> not being aligned in editor (or aligned to its initial), aligned to center in preview
->
-
-### C. Custom Highlight Color
-
-Color of each highlight can be customized by adding color tag exactly after its opening delimiter. The tag consists of opening curly bracket `{`, alphanumeric character(s) `a-zA-Z0-9` (at least one, can be added with minus sign `-`), and closing curly bracket, for example: `=={red}Red==, =={Green2}Green==, =={ocean-blue}Blue==`.
-
-| Valid color tag | Invalid color tag |
-| ---------------------- | --------------------------------------------------------- |
-| `=={color}lorem==` | `== {color}lorem==`, `==a{color}lorem==` |
-| `=={abcAb--10}lorem==` | `=={ }lorem==,` `=={*_}lorem==`, `=={green_color}lorem==` |
-
-Valid color tag will be added in the highlight classes, so `=={red}Red==` will be parsed in html tag as **``** in editor and **``** in preview mode. This plugin bring some predefined CSS rules that automatically give customized color to the highlight. Those predifined colors are red, orange, yellow, green, cyan, blue, purple, pink, and accent (accent color of your app).
-
-For ease access, in the editor, the color button will appear after opening delimiter when the cursor or selection touches the highlight. Clicking on it shows colors menu and let the user choose the desired color (you can disable the color botton in settings, and thus will be hidden in the editor).
-
-
-
-> [!note]
->
-> Currently, other colors can only be customized through CSS. In the future, I would like to add a feature that can customize and add other colors through the settings.
-
-### D. Context-aware Formatting
-
-Any syntaxes that are written in the codespan, codeblock, math, comment, and wikilink don't apply the rules, so they are treated according to their context. Or, in the nutshell, they aren't formatted. This corresponds to the many of Markdown implementation, as well as that implemented in Obsidian.
-
-In addition in the editor, any formatting above doesn't overlapping its block context. So if opening delimiter, i.e. double plus signs for insertion, was found in heading, and didn't meet any double plus signs but in the next line (which is paragraph for instance), then the second delimiter isn't treated as a closing for that opening.
+In addition in the editor, any formatting above doesn't overlapping its block context. So if a opening delimiter, i.e. double plus signs for insertion, was found in heading, and didn't meet any double plus signs but in the next line (which is paragraph for instance), then the second delimiter isn't treated as a closing for that opening.
Example below can give some better understanding:
@@ -196,43 +231,65 @@ Expected result:
> another list
>
lazy continuation
+## Installation
+
+- In-app
+ - Open settings.
+ - Choose "Community plugins" setting tab.
+ - Turn off "Restricted mode" if it was enabled before.
+ - Click "Browse" at "Community plugins" item.
+ - Type "Extended Markdown Syntax" in the search box.
+ - Install and enable it.
+- Manual
+ - Create a folder named `extended-markdown-parser` under `.obsidian/plugins`.
+ - Place `manifest.json`, `main.js`, and `style.css` from the latest release into the folder.
+ - Enable it through the "Community plugin" setting tab.
+- Using [BRAT](https://github.com/TfTHacker/obsidian42-brat).
+
---
## FAQ's
### Is it working on the table and callout?
-Of course it's working on both.
+Of course it's working on both, except for the fenced div.
### Does the plugin work on large files?
-I tested it on a 250kB file and it's still working. This plugin also uses parser that implemented simple incremental and partial parsing, so you don't need to worry about facing with big files. But if you still have some issues with it, feel free to inform me what the issues you are struggling with.
+I tested it on a 250kB file and it's still working fine. This plugin also uses parser that implemented simple incremental and partial parsing, so you don't need to worry about facing with large files. But if you still have some issues with it, feel free to inform me what the issues you are struggling with.
-### Can I use another color for highlights, other than those specified?
-For sure. But, for the moment, you can only do color customizing through the CSS. Use selector `.cm-custom-highlight.cm-custom-highlight-YOURCOLOR, .custom-highlight custom-highlight-YOURCOLOR` in the CSS rule (change "YOURCOLOR" with the text you will use in the color tag) and set the `background-color` as you desire.
-
-I have plan in the future to implement it in the settings.
+### Will it cause conflict with other plugins that concerns extending syntax?
+It depends on what character the others use in their syntax.
## Features to be Implemented in The Future
- [x] Enable/disable formatting in settings
- [x] Applicable on mobile
-- [ ] Fixing paragraph alignment bug
-- [ ] Customize formatting styles and highlighting colors
+- [x] ~~Fixing paragraph alignment bug~~ For now, use fenced div to customize block level format
+- [x] Customize highlighting colors
+- [ ] Customize formatting styles
- [ ] Applying syntax quickly using shortcuts and context menu
-- [ ] More syntaxes, if necessary
+- [ ] Class suggester for custom span and fenced div
+- [ ] ~~More syntax, if necessary~~ *I'll be over here for a while*
-## Other Known Issues
+## Compatibility Note
-- Cannot escape spoilers that are inside table cells (in source mode)
+This plugin have been tested in the latest version of Obsidian (about 1.7.x - 1.8.x), and haven't been tested yet in the version 1.6.x and below.
+
+## Known Issues
+
+- Delimiter escaping doesn't work in the preview mode.
+- Cannot escape spoilers that are inside table cells (in source mode). (**cannot be fixed**)
+- ~~Sometimes, faster scrolling on a big file (by using scroll bar thumbs and moving it suddenly to the bottom) breaks the customized highlight color. (*can be fixed temporarily by scrolling with fair speed through the highlight*)~~ _Already fixed_
Feel free to let me know if you find any bugs...
## Credit
Thanks to:
-- [Pandoc](https://pandoc.org/MANUAL.html) for the idea of superscript and subscript,
-- [CommonMark](https://spec.commonmark.org/) and [Github Flavored Markdown](https://github.github.com/gfm/) for the Markdown specification.
+- [Pandoc](https://pandoc.org/MANUAL.html) for the idea of some syntax,
+- [CommonMark](https://spec.commonmark.org/) and [Github Flavored Markdown](https://github.github.com/gfm/) for the markdown specification.
- [Discord](https://discord.com/) for the spoiler idea.
- [Superschnizel](https://github.com/Superschnizel/obisdian-fast-text-color) for interactive menu idea,
+- [Exaroth](https://github.com/exaroth/mdx_custom_span_class) for custom span idea.
- [Mara-Li](https://github.com/Mara-Li/obsidian-regex-mark) for some code snippets,
- [marcel-goldammer](https://github.com/marcel-goldammer/obsidian-keyword-highlighter),
- [attcoleanderson](https://github.com/mattcoleanderson/obsidian-dynamic-text-concealer)
\ No newline at end of file