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

RFC Add common mark support #53

Open
SerafimArts opened this issue Dec 22, 2017 · 0 comments
Open

RFC Add common mark support #53

SerafimArts opened this issue Dec 22, 2017 · 0 comments

Comments

@SerafimArts
Copy link
Member

SerafimArts commented Dec 22, 2017

Descriptions the description requires rendering support in the markdown.

"""
This is an example of list:
- Some
- Any
"""
type Example {}

Current behaviour:

\var_dump($example->getDescription());

// string(...) "This is an example of list:\n- Some\n- Any"

Required behaviour:

\var_dump($example->getDescription());

// string(...) "This is an example of list:\n- Some\n- Any"


$renderer = new HtmlRenderer();
\var_dump($example->getDescription($renderer));

// string(...) "<p>This is an example of list:</p><ul><li>Some</li><li>Any</li></ul>"

The method signature must be updated:

public function getDescription(Renderer $renderer = null): string
{
    return $renderer ? $renderer->render(/* description */) : /* description */;
}

Related spec:

https://github.com/facebook/graphql/blob/b0b517360e5eee43f337ce7006078ed4907a83ab/spec/Section%202%20--%20Language.md#descriptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant