react-markdown-table-ts 1.4.5 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  | `'light'` theme | `'dark'` theme |
13
13
 
14
14
  ## Overview
15
- A React component for generating and displaying formatted Markdown tables with syntax highlighting. The core component is `MarkdownTable` which converts 2D array data into properly formatted Markdown table syntax. Columns of variable width maintain consistent spacing across all rows, ensuring vertical alignment of delimiters. For syntax highlighting and line numbering, Prism.js is used within a `<pre>` HTML element.
15
+ A React component for generating and displaying formatted Markdown tables. The core component is `MarkdownTable` which converts 2D array data into properly formatted Markdown table syntax. Columns of variable width maintain consistent spacing across all rows, ensuring vertical alignment of delimiters. The output is displayed in a styled `<pre>` element with optional line numbering and supports both light and dark themes.
16
16
 
17
17
  ## Installation
18
18
 
@@ -20,7 +20,7 @@ A React component for generating and displaying formatted Markdown tables with s
20
20
  npm install react-markdown-table-ts
21
21
  ```
22
22
 
23
- The component includes all necessary Prism.js dependencies and CSS is embedded inline, so no additional setup is required.
23
+ The component includes all necessary dependencies and CSS is embedded inline, so no additional setup is required.
24
24
 
25
25
  ## API
26
26
  ```typescript
@@ -55,7 +55,7 @@ interface MarkdownTableProps {
55
55
  | `className` | `string` | `undefined` | Class will be applied to the \<pre\> element display. |
56
56
  | `preStyle` | `React.CSSProperties` | `undefined` | Allows direct styling of the display with CSS properties. |
57
57
  | `minWidth` | `number` | `undefined` | Optional minimum width in pixels for the table container. |
58
- | `showLineNumbers` | `boolean` | `true` | Show or hide line numbers in the Prism syntax highlighting. |
58
+ | `showLineNumbers` | `boolean` | `true` | Show or hide line numbers in the code block. |
59
59
  | `onGenerate` | `(markdownTableString: string) => void` | `undefined` | Callback to receive the generated Markdown table string. |
60
60
  ## Usage Patterns
61
61
 
@@ -116,9 +116,9 @@ interface MarkdownTableProps {
116
116
  - Preserves stack traces for debugging
117
117
 
118
118
  4. **Styling**:
119
- - Uses Prism.js for syntax highlighting
120
- - Supports light/dark themes
119
+ - Includes built-in light and dark themes
121
120
  - Custom styles via `className` and `preStyle` props
121
+ - Optional line numbers for better readability
122
122
 
123
123
  ## Common Transformations
124
124
 
@@ -133,31 +133,16 @@ interface MarkdownTableProps {
133
133
 
134
134
  ## Troubleshooting
135
135
 
136
- ### Styling Issues (Missing Line Numbers or Wrong Colors)
136
+ ### Styling Issues
137
137
 
138
- If you experience styling issues when importing this component into your project (e.g., missing line numbers, incorrect header colors), this may be due to your bundler's tree-shaking configuration.
138
+ If you experience styling issues when importing this component into your project (e.g., missing line numbers, incorrect colors), this may be due to CSS conflicts with other libraries or global styles in your application.
139
139
 
140
- **Solution 1 - Module Side Effects (Recommended)**
140
+ **Common Solutions:**
141
141
 
142
- Ensure your bundler preserves module side effects from this package. If using Webpack, add to your config:
142
+ 1. **Check for CSS conflicts**: Ensure no other libraries or global styles are overriding the component's built-in CSS.
143
143
 
144
- ```javascript
145
- module.exports = {
146
- // ... other config
147
- optimization: {
148
- sideEffects: true,
149
- },
150
- };
151
- ```
152
-
153
- **Solution 2 - Force Import**
144
+ 2. **Verify theme prop**: Make sure you're using the correct `theme` prop value (`'light'` or `'dark'`) for your application.
154
145
 
155
- If issues persist, you can manually import the Prism.js plugins in your app entry file:
156
-
157
- ```javascript
158
- import 'prismjs/components/prism-markdown';
159
- import 'prismjs/plugins/line-numbers/prism-line-numbers';
160
- import 'prismjs/plugins/line-numbers/prism-line-numbers.css';
161
- ```
146
+ 3. **Custom styling**: Use the `className` and `preStyle` props to add custom styles or override defaults as needed.
162
147
 
163
- Note: You may need to install `@types/prismjs` as a dev dependency for TypeScript projects.
148
+ 4. **Line numbers**: If line numbers aren't displaying, verify that `showLineNumbers` is set to `true` (default).