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

Paste caption shortcode #2478

Closed
wants to merge 1 commit into from
Closed

Conversation

ellatrix
Copy link
Member

This is a first attempt at handling pasted shortcodes.

  • Shortcode handling needs to occur before anything else, otherwise we risk losing important info or splitting the shortcode.
  • I've created block transforms for this, so it will the the image block that handles the caption shortcode, gallery that handles the gallery shortcode etc.
  • I'd like to regard the shortcode attributes as the "sourced" attributes we have for blocks, then parse the content of the shortcode with hpq.

While I used the core shortcodes script in this PR, I think we should bundle it so that we can write tests.

@codecov
Copy link

codecov bot commented Aug 20, 2017

Codecov Report

Merging #2478 into master will increase coverage by 0.22%.
The diff coverage is 73.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2478      +/-   ##
=========================================
+ Coverage   26.88%   27.1%   +0.22%     
=========================================
  Files         158     160       +2     
  Lines        4892    5109     +217     
  Branches      814     872      +58     
=========================================
+ Hits         1315    1385      +70     
- Misses       3034    3143     +109     
- Partials      543     581      +38
Impacted Files Coverage Δ
blocks/editable/index.js 11.06% <0%> (-0.05%) ⬇️
blocks/api/paste/strip-wrappers.js 100% <100%> (ø) ⬆️
blocks/api/paste/normalise-blocks.js 96.87% <100%> (+0.2%) ⬆️
blocks/api/paste/strip-attributes.js 100% <100%> (ø) ⬆️
blocks/api/paste/convert-shortcodes.js 44.44% <44.44%> (ø)
blocks/library/image/index.js 14.63% <50%> (-0.37%) ⬇️
blocks/api/paste/index.js 95.23% <95.23%> (-4.77%) ⬇️
editor/header/saved-state/index.js 75% <0%> (-10.72%) ⬇️
blocks/library/heading/index.js 18.91% <0%> (-4.9%) ⬇️
editor/modes/visual-editor/block.js 0% <0%> (ø) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a99994...bbed98d. Read the comment docs.

@ellatrix ellatrix added the [Status] In Progress Tracking issues with work in progress label Aug 20, 2017
@ellatrix
Copy link
Member Author

ellatrix commented Oct 4, 2017

Closing in favour of #2874.

@ellatrix ellatrix closed this Oct 4, 2017
@ellatrix ellatrix deleted the try/paste-caption-shortcode branch October 4, 2017 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant