Skip to content

Conversation

mattheu
Copy link
Contributor

@mattheu mattheu commented Feb 20, 2015

See #171

A few concerns here

  • Should this always run or should we set a flag?
  • Should we really be using _wp_Nop?
  • Is this a situation where it would be good to have unit tests? Maybe we should start some.

@danielbachhuber
Copy link
Contributor

Should this always run or should we set a flag?

I think we need to always run, or not run. Decisions not options ;)

Should we really be using _wp_Nop?

I'm not convinced. Seems like we'd make the code more brittle by being dependent on switchEditors

Is this a situation where it would be good to have unit tests?

Yep

@mattheu
Copy link
Contributor Author

mattheu commented Feb 20, 2015

After doing some further testing - I think its fine to just always run this.

Agreed that we don't want to depend on switchEditors, _wp_Nop is a pretty hacky ~100 lines of regex that I don't really want to duplicate - and I guess that we would be able to support fewer edge cases.

I've written some simpler regex to do this - should be sufficient. I'll look into doing some tests for this before we merge though.

@danielbachhuber
Copy link
Contributor

Agreed that we don't want to depend on switchEditors

Can we make it fail gracefully then if the variable isn't there?

@mattheu
Copy link
Contributor Author

mattheu commented Feb 20, 2015

Sure. I think if we go down the route of supporting the WP editor inside shortcake ui, and also nested shortcodes, we want this to be pretty robust and I'd rather lean on the built-in WP Core functionality where possible

@mattheu
Copy link
Contributor Author

mattheu commented Apr 20, 2015

I've synced this up with master and added some of the things we discussed.

However this is no longer working with WP trunk. The problem is that MCE views no longer work at all if the shortcode content has HTML. I think this broke here: WordPress/WordPress@b799bd8

I'll look into how feasable this is to support.

@mattheu
Copy link
Contributor Author

mattheu commented Jun 2, 2015

Support for HTML and line breaks just got fixed in core. See https://core.trac.wordpress.org/changeset/32678

A somewhat simpler solution to #322 - although it only works for the inner content, and not data stored in attributes.

I think this should go in regardless of #322, and we can review whether we need to extend support for HTML to all attributes.

@danielbachhuber danielbachhuber added this to the v0.4.0 milestone Jun 2, 2015
danielbachhuber pushed a commit that referenced this pull request Jun 2, 2015
Run content through _wp_Nop
@danielbachhuber danielbachhuber merged commit 9af2f73 into master Jun 2, 2015
@danielbachhuber danielbachhuber deleted the fix-autop branch June 2, 2015 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants