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

Test case showing code element is blocks & spans #50

Closed

Conversation

mAAdhaTTah
Copy link

@mAAdhaTTah mAAdhaTTah commented Nov 21, 2017

The docs provide the list of elements and the parameters passed to the functions that generate them, including a code & codespan tag. It appears, based on my digging into this issue in spectacle that code is actually used for both code and codespan elements. My understanding (and the understanding of the Spectacle guys) appear to be that code is for code blocks, wrapped in a pre, whereas codespan is for inline code. However, we have this test:

it('should allow overriding code element with components version', () => {
  const compile = marksyComponents({
    createElement,
    elements: {
      code() {
        return <div>code</div>
      }
    }
  });
  const compiled = compile('Hello `code`');

  const tree = renderer.create(
    <TestComponent>{compiled.tree}</TestComponent>
  ).toJSON();

  expect(tree).toMatchSnapshot();
});

That indicates that the code work on inline blocks. However, the test I just added indicates that code is also used for code blocks as well. So there's currently no hook for the codespan element currently indicated in the docs.

I'm opening up the test case to demonstrate the issue and get some guidance on how to fix it. Thoughts?

@mAAdhaTTah
Copy link
Author

Pffft this is what I get for not looking around. This would be fixed by #47.

@mAAdhaTTah mAAdhaTTah closed this Nov 21, 2017
@mAAdhaTTah mAAdhaTTah deleted the test-case-for-codespan-bug branch November 21, 2017 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant