-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: adds basic tables support #41
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduced a new `TableExample` class in `table_example.dart` to demonstrate various HTML table structures, including basic tables, tables with colspan and rowspan, and styled tables. - Updated `examples.dart` to include the new `TableExample` in the list of examples, providing a title, description, path, and builder function for navigation.
- Added a new `TableConverter` to handle HTML table elements in the Tagflow library. - Updated the `ROADMAP.md` to reflect the completion of various HTML elements, including articles, sections, lists, and basic table structure. - Included the `meta` package as a dependency in `pubspec.yaml` for enhanced functionality.
- Added a new abstract class `TagflowNode` to unify the handling of nodes in the Tagflow library. - Updated `TagflowElement` to extend `TagflowNode`, enhancing the structure for representing HTML elements. - Refactored various converters (e.g., `ElementConverter`, `BlockquoteConverter`, `CodeConverter`, etc.) to work with the new `TagflowNode` type. - Introduced utility extensions for `TagflowNode` to simplify attribute handling and style management. - Added a new `TagflowTableElement` class to support table structures, including row and column management. - Updated the `resolveStyle` method in `TagflowTheme` to accommodate the new node structure. - Included utility functions in `utils.dart` for better code organization.
- Added a line length ignore directive to `converter.dart` to prevent linting issues. - Updated the TODO comment in `table_element.dart` to include the author's name for better tracking of implementation tasks.
- Added a new `TagflowImgElement` class to represent image elements in the Tagflow library, encapsulating attributes like `src` and `alt`. - Updated `ImgConverter` to work with `TagflowImgElement` instead of the generic `TagflowElement`, enhancing type safety and clarity. - Modified `TagflowSelectableOptions` to use `TagflowImgElement` in the image selection behavior text builder. - Removed redundant media-related extensions from `TagflowNode`, streamlining the codebase.
- Introduced a new method `hasAttribute` in the `TagflowNode` abstract class to check for the presence of a specific attribute in the node's attributes. - Removed the redundant `hasAttribute` extension from `TagflowNodeExtensions`, streamlining the codebase and consolidating functionality within the `TagflowNode` class.
…ucture - Changed the type of `_element` in `Tagflow` from `TagflowElement` to `TagflowNode` for better abstraction. - Updated `TagflowElement`, `TagflowImgElement`, and `TagflowTableElement` to use `const` constructors and improved attribute handling. - Introduced new `NodeParser` classes (`ElementParser`, `ImgParser`, `TableParser`) to handle specific HTML elements, enhancing parsing capabilities. - Refactored the `TagflowParser` to utilize the new parsers, improving modularity and maintainability. - Enhanced the `reparent` method across various element classes to ensure proper parent-child relationships. - Added utility functions for attribute parsing and normalization in the new parser structure.
- Updated the `NodeParser` classes to include a `TagflowParser` parameter in the `tryParse` method for improved parsing capabilities. - Introduced a new `_normalizeClasses` method to clean up class attribute values. - Refactored `parseChildren` methods across various parsers to utilize the new parser structure, enhancing modularity. - Added logging of text content in the `TextConverter` for better debugging. - Updated tests to reflect changes in the `TagflowElement` instantiation.
- Removed logging statements from custom and built-in converters in `converter.dart` for cleaner output. - Refactored the `getPrefix` method in `ListItemConverter` to ensure the index is only calculated when the list is ordered. - Updated `TextConverter` to eliminate unnecessary logging of text content. - Modified `TagflowElement`, `TagflowImgElement`, and `TagflowNode` to streamline the properties used in equality checks, enhancing performance and clarity.
…onverters - Changed header tags in `table_example.dart` from `<h2>` to `<h3>` for better semantic structure. - Enhanced `TableConverter` to return a styled container for tables, improving visual representation. - Updated `TextConverter` to support table-related tags (`tr`, `td`, `th`), expanding its functionality. - Modified `TagflowTableElement` to flatten the children list for easier access to cell elements. - Adjusted `TableParser` to initialize spans as a mutable map for better flexibility. - Refined `TagflowTheme` to improve styling for table headers, ensuring consistent appearance.
…amples - Updated `table_example.dart` to improve the visual representation of table rows by adding a text color. - Introduced a new `lookupParent` method in `converter.dart` to facilitate parent tag lookups for better style resolution. - Enhanced `TableConverter` to utilize row-based styling and improved child conversion logic. - Added `TableCellConverter` to support table cell-specific styling and behavior. - Refactored `TextConverter` to integrate text style with color for table-related tags. - Updated `TagflowTableElement` to manage rows and columns more effectively, ensuring proper child handling. - Improved `StyleParser` to include color parsing for enhanced style management.
…ers and theme - Enhanced `TableConverter` to apply a default border style with zero width for improved visual consistency. - Updated `TagflowTheme` to define a default table border width, ensuring consistent styling across table elements. - Refined table border properties in the `Table` widget to utilize effective border styles from the theme.
…in tests - Updated the test for managing parent-child relationships to instantiate the parent element with its child directly, enhancing clarity and reducing complexity. - Adjusted the way the child element is accessed, ensuring it reflects the new structure of the parent element.
- Enhanced the `coverage` script to include a `packageFilters` option for directories containing tests. - Updated the `combine-coverage` script to add a `packageFilters` option for directories containing coverage reports, improving the flexibility of coverage report generation.
- Introduced a new test file for ImgParser, validating its ability to identify img elements and parse their attributes correctly. - Added tests to ensure proper handling of missing attributes, enhancing the robustness of the ImgParser implementation.
- Introduced a new test file for TableConverter, validating its support for table tags and rendering functionality. - Added tests to ensure correct application of styles and inheritance from parent elements in table structures. - Exported the parsers from the core parser module to enhance accessibility for table-related parsing operations.
- Removed unused imports from parser and table_parser files to streamline code. - Introduced a new test file for TableParser, validating its ability to handle various table structures and attributes. - Added tests for identifying table elements, parsing basic structures, handling empty cells, and preserving attributes, improving test coverage and reliability.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Huly®: TAGFL-41