You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add option for line-wrapping to prevent horizontal scrolling (#20)
* feat: add option for line-wrapping to prevent horizontal scrolling
* chore: remove accidentally commited npm script
* fix: make line numbers unselectable
* chore: replace Ace text highlight rules with in-repo function
* chore: Fix minimum-height and actions absolute positioning
* fix: Fix code indentation by setting white-space to pre
* chore: Fix code color and lines Box variant
* chore: Add multi-line test
* chore: Increase size-limit by 8 bytes
* chore: Use logical properties
* chore: Update findContent() test to be backward compatible
* Give <table> role="presentation"
* feat: add option for line-wrapping to prevent horizontal scrolling
* chore: remove accidentally commited npm script
* fix: make line numbers unselectable
* chore: replace Ace text highlight rules with in-repo function
* chore: Fix minimum-height and actions absolute positioning
* fix: Fix code indentation by setting white-space to pre
* chore: Fix code color and lines Box variant
* chore: Add multi-line test
* chore: Increase size-limit by 8 bytes
* Give <table> role="presentation"
* Increase size limit
* chore: increase size-limit
* small fixes after merging up to main
* small fix after merging up to main
* bump size limit
* keep test util backwards compatible
* small fixes from mistakes made while merging
* revert highlight function type to return ReactNode
* add syntax highlighting example line wrapping page
* small refactor
* wrap text on pages in Box components
* update parameter jsdoc
* update documentation snapshot
* update prop name to wrapLines
* add word break
* bump size
---------
Co-authored-by: Ruben Carvalho <[email protected]>
Co-authored-by: Gethin Webster <[email protected]>
Co-authored-by: Gethin Webster <[email protected]>
Co-authored-by: Alice Koreman <[email protected]>
content={`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`}
content={`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`}
content={`Hello this is a short line.\nHello this is a long line. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nHello this is another short line.`}
18
+
/>
19
+
<Box>No wrapping, line numbers</Box>
20
+
<CodeView
21
+
lineNumbers={true}
22
+
content={`Hello this is a short line.\nHello this is a long line. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nHello this is another short line.`}
23
+
/>
24
+
<Box>Wrapping, no line numbers</Box>
25
+
<CodeView
26
+
wrapLines={true}
27
+
content={`Hello this is a short line.\nHello this is a long line. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nHello this is another short line.`}
28
+
/>
29
+
<Box>Wrapping, line numbers</Box>
30
+
<CodeView
31
+
wrapLines={true}
32
+
lineNumbers={true}
33
+
content={`Hello this is a short line.\nHello this is a long line. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nHello this is another short line.`}
34
+
/>
35
+
<Box>Full example with indentation and code highlighting</Box>
36
+
<CodeView
37
+
wrapLines={true}
38
+
lineNumbers={true}
39
+
highlight={cppHighlight}
40
+
content={`void UserQuery(map<string, vector<string> > &svmap) {\n string queryName;\n cout << "Please enter a family name you want to query: ";\n cin >> queryName;\n int i = 0;\n for (map<string, vector<string> >::iterator itr = svmap.begin(), mapEnd = svmap.end(); itr != mapEnd; ++itr) {\n i++;\n if (itr->first == queryName) {\n cout << "The " << itr->first << " family has " << itr->second.size() << " children: ";\n for (vector<string>::iterator itrvec = itr->second.begin(), vecEnd = itr->second.end(); itrvec != vecEnd; ++itrvec)\n cout << *itrvec << " ";\n break;\n }\n }\n if (i >= svmap.size())\n cout << "Sorry, the " << queryName << " family is not found." << endl;\n}`}
0 commit comments