Skip to content

feat: new rendererOption: spaceToHtmlTag #60

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

Merged
merged 1 commit into from
Sep 25, 2022
Merged

Conversation

jfcherng
Copy link
Owner

convert spaces/tabs into HTML codes like <span class="ch sp"> </span> and the frontend is responsible for rendering them with CSS. when using this, "spacesToNbsp" should be false and "tabSize" is not respected.


Tested with

    // convert spaces/tabs into HTML codes like `<span class="ch sp"> </span>`
    // and the frontend is responsible for rendering them with CSS.
    // when using this, "spacesToNbsp" should be false and "tabSize" is not respected.
    'spaceToHtmlTag' => true,
    // the frontend HTML could use CSS "white-space: pre;" to visualize consecutive whitespaces
    // but if you want to visualize them in the backend with "&nbsp;", you can set this to true
    'spacesToNbsp' => false,

image


Resolves #58

@jfcherng jfcherng added the enhancement New feature or request label Sep 21, 2022
convert spaces/tabs into HTML codes like `<span class="ch sp"> </span>`
and the frontend is responsible for rendering them with CSS.
when using this, "spacesToNbsp" should be false and "tabSize" is not respected.

Signed-off-by: Jack Cherng <[email protected]>
@jfcherng jfcherng mentioned this pull request Sep 25, 2022
@brianteeman
Copy link
Contributor

brianteeman commented Sep 25, 2022

Looks great. Dont have time to test properly until wednesday but I don't see any obvious problems.

@brianteeman
Copy link
Contributor

tested and it works perfectly - thanks - looking forward to using it

@jfcherng jfcherng merged commit 97791ea into v6 Sep 25, 2022
@jfcherng jfcherng deleted the feat/tab-space-mark branch September 25, 2022 13:45
jfcherng added a commit that referenced this pull request Sep 25, 2022
@jfcherng
Copy link
Owner Author

Has been released in 6.10.6 (for PHP >= 7.1) and 6.12.0 (for PHP >= 7.4).

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

Successfully merging this pull request may close these issues.

tabs and spaces
2 participants