Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Markdown & SyntaxHighlighter children prop should accept an array of strings  #134

Closed

Description

@cpsievert

Providing one long string is susceptible to unintended consequences from indentation rules (e.g. markdown interpreting 4 spaces as a code block). Being able to provide an array of strings would help avoid that problem somewhat.

Seems like we could just do children.join('\n') when children is an array?

@chriddyp happy to submit a PR if you think this is worthwhile (not sure how to set propTypes so that both an array and a string would be acceptable).

Activity

  1. chriddyp commented on Jan 2, 2018

    @chriddyp
    Member

    yeah, that's a good idea. sure, I'll accept a PR on this. See https://reactjs.org/docs/typechecking-with-proptypes.html for more on proptypes. PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]) should work here.

  2. added 2 commits that reference this issue on Jan 2, 2018
    bd1475d
    8e1d90d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions