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

Support for code titles with spaces #2

Closed
talatkuyuk opened this issue Jan 24, 2023 · 1 comment
Closed

Support for code titles with spaces #2

talatkuyuk opened this issue Jan 24, 2023 · 1 comment
Labels
assign self enhancement New feature or request

Comments

@talatkuyuk
Copy link
Contributor

talatkuyuk commented Jan 24, 2023

Supporting space is a bit tricky. We can solve the problem by using a special character as a substitute for the space character in the title part.

What could be:

  • option-1 --> @ The@title@for@code@block
  • option-2 --> * this may not work! Other plugins may effects.
  • option-3 --> ~ this may not work! Other plugins may effects.
  • option-4 --> what could be else? What is your preference?
@talatkuyuk talatkuyuk added assign self enhancement New feature or request labels Jan 27, 2023
@talatkuyuk
Copy link
Contributor Author

Fixed with the version 1.2.0

Added an option for the issue: tokenForSpaceInTitle

tokenForSpaceInTitle

It is a string option for composing the title with more than one word.

Normally, the remark-flexible-code-titles can match a code title which is the word that comes after a colon and ends in the first space it encounters. This option is provided to replace a space with a token in order to specify a code title consisting of more than one word.

use(remarkCodeTitles, {
  tokenForSpaceInTitle: "@",
});

Now, the titles that have more than one word can be set using the token @.

```bash:Useful@Bash@Commands
mkdir project-directory
```
<div class="remark-code-container">
  <div class="remark-code-title">Useful Bash Commands</div>
  <pre>
    <code class="language-bash">mkdir project-directory</code>
  <pre>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assign self enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant