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

[PropTypeDescription] Add support for multi-line function @param and … #3570

Merged
merged 1 commit into from
Mar 4, 2016
Merged

[PropTypeDescription] Add support for multi-line function @param and … #3570

merged 1 commit into from
Mar 4, 2016

Conversation

theosherry
Copy link
Contributor

Here's the PropTypeDescription changes that were initially part of #3550 .

If there are newlines in the tags' descriptions it messes up the output markdown. This PR just removes the newlines from the descriptions of the function @param and @returns tags and adds a space. I followed what was already done to address the same problem with the non-function descriptions.

@@ -68,17 +68,27 @@ function generateDescription(required, description, type) {
let signature = '';

if (type.name === 'func' && parsed.tags.length > 0) {
// Remove new lines from any tag descriptions to avoid markdown errors.
const parsedTags = parsed.tags.map((tag) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parsed.tags.forEach((tag) => {
  if (tag.description) {
    tag.description = tag.description.replace(/\n/g, ' ')
  }
});

Is simpler. and you won't have to introduce a new variable parsedTags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah of course; I'll change that.

@alitaheri
Copy link
Member

This is looking great, thanks 👍

@callemall/material-ui Review and merge, thanks 👍

mbrookes added a commit that referenced this pull request Mar 4, 2016
…e_fix

[PropTypeDescription] Add support for multi-line function @param and …
@mbrookes mbrookes merged commit 1d88b35 into mui:master Mar 4, 2016
mbradleyis pushed a commit to staticinstance/material-ui that referenced this pull request Mar 7, 2016
…line_fix

[PropTypeDescription] Add support for multi-line function @param and …
@zannager zannager added docs Improvements or additions to the documentation component: autocomplete This is the name of the generic UI component, not the React module! labels Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants