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

Configuring numberOfLines for the whole markdown #244

Open
gregoripolak opened this issue Feb 2, 2025 · 0 comments
Open

Configuring numberOfLines for the whole markdown #244

gregoripolak opened this issue Feb 2, 2025 · 0 comments

Comments

@gregoripolak
Copy link

Issue Description

Hello, I am working on integrating the react-native-markdown-display into our application to display Markdown content. We have a global requirement to limit the number of visible lines across all Markdown-rendered content. Currently, I see that we can apply styles or rules to individual Markdown elements, but there does not seem to be a way to set a maxNumberOfLines for the entire content block universally.

Expected Behavior

I would like to be able to pass a numberOfLines prop to the Markdown component that applies this limit to the entire content, not just specific elements. Here's a conceptual API I am looking for:

const ContentViewer = ({ content, numberOfLines }) => {
  return <Markdown style={styles} numberOfLines={numberOfLines}>
    {content}
  </Markdown>;
};

Current Behavior

Currently, the library allows styling individual elements, but applying a global numberOfLines restriction requires custom implementation for each element type.

Environment

Package Version: 7.0.2
React Native Version: 0.74.3
Platform: iOS & Android

Question

Is there a workaround or potential update that could support this feature? If not, could this be considered for a future release? Any guidance or suggestions on how I might implement this feature myself would also be greatly appreciated.

Thank you for your work on this package and for considering this feature request.

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

No branches or pull requests

1 participant