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

Decentering of a centered text #489

Closed
keshav234156 opened this issue May 6, 2020 · 3 comments · Fixed by #521
Closed

Decentering of a centered text #489

keshav234156 opened this issue May 6, 2020 · 3 comments · Fixed by #521
Labels

Comments

@keshav234156
Copy link
Member

If a text has already been centered by a user(and it may happen sometimes by mistake ) then it can’t be uncentered. Also if you want further paragraphs to be uncentered then it’s not possible now.

@jywarren
Copy link
Member

Just labeling this bug -- let's try to do good thorough labeling here! Thank you!

@shreyaa-s-zz
Copy link
Collaborator

I've made the changes for wysiwyg mode. This is how the center aligning works in markdown.

else if (mode == "markdown") {
      chunks.selection = _module.wysiwyg.parseHTML("<center>"+chunks.selection+"</center>")
    }

    _module.afterParse();

Any ideas on how decentering could be implemented in markdown?
Also, how do we need decentering to work in markdown? I think the main purpose of a toolbar in markdown mode is for adding the syntax that the user might not be aware of. In md the users can easily see and improvise the -> and <- symbols used for centering, then do we need an interface to remove it as well? What do you all think?
cc: @jywarren @keshav234156 @NitinBhasneria @Shulammite-Aso

@keshav234156
Copy link
Member Author

I think we should allow de-centering from the toolbar as well as all other modules all allowing it.
we can basically remove -> and <- from chunks.before and chunks.after

shreyaa-s-zz pushed a commit to shreyaa-s-zz/PublicLab.Editor that referenced this issue Jun 1, 2020
* MODIFIED: dist/Publiclab.Editor.js -> function initAutoCenter

* enables decentering in both modes

* selecting a center aligned text and re-aligning left aligns the text

* selecting a center aligned text as substring of a string center aligns the complete string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants