Skip to content

fix: incorrect detection of editor mode#234

Merged
smeijer merged 1 commit intodevelopfrom
feature/fix-cm-mode
Jul 1, 2020
Merged

fix: incorrect detection of editor mode#234
smeijer merged 1 commit intodevelopfrom
feature/fix-cm-mode

Conversation

@smeijer
Copy link
Member

@smeijer smeijer commented Jul 1, 2020

What:
fix editor mode detection for automated formatting

Why:
this fix exists on live but wasn't backported to develop yet

How:
For some reason, options.mode is sometimes a string like html, and sometimes an object like { name: 'html' }. Fix is a simple one-liner:

const mode = cm.options.mode.name || cm.options.mode;

Checklist:

  • Tests
  • Ready to be merged

@smeijer smeijer added the bug Something isn't working label Jul 1, 2020
@smeijer smeijer self-assigned this Jul 1, 2020
@smeijer smeijer merged commit dc6bd70 into develop Jul 1, 2020
@smeijer smeijer deleted the feature/fix-cm-mode branch July 1, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant