-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
HTML tags #34
Merged
dhorions
merged 32 commits into
dhorions:master
from
SZUE:frulenzo/html-tags-with-tokenizer
Apr 2, 2016
Merged
HTML tags #34
dhorions
merged 32 commits into
dhorions:master
from
SZUE:frulenzo/html-tags-with-tokenizer
Apr 2, 2016
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
…WrappingFunction class also).
…ass if argument is null
…by adding current pipeline text to width sum
…t in Table and Paragraph classes
Conflicts: src/main/java/be/quodlibet/boxable/Table.java
…and implemented text rotation with tokens Conflicts: src/main/java/be/quodlibet/boxable/Cell.java src/main/java/be/quodlibet/boxable/Table.java
Conflicts: src/main/java/be/quodlibet/boxable/Table.java
Conflicts: src/main/java/be/quodlibet/boxable/Cell.java src/main/java/be/quodlibet/boxable/Table.java
I'll try to find time to review this over the weekend, it looks nice and if I don't find any issues will merge it into the main branch. |
This is really useful, thanks a lot! |
Closed
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.
Hi,
It would be nice to format text with some HTML tags, right? No problem, now we have it 👍
What is new?
Token Class
Just simple class which represent a token. Token has
TokenType
and token'sdata
.TokenType Enum
There is multiple token's type :
Tokenizer class
This is the class which main focus is simple parsing text in designated
Token
s. Class has only one methodtokenize(final String text, final WrappingFunction wrappingFunction)
. First argumen is text that we want to parse and the second argument is our well known wrapping function which determine how the text will be parsed.TokenizerTest
Simple class with multiple JUnit tests as :
testWrapPoints()
,testSimpleItalic()
,testBoldAndItalic()
etc..PipelineLayer class
Main focus of this class is to ensure correct "breaking" lines inside
Paragraph
depending on width. There is two usage of this class, as textInLine which represent a pipeline of current line text and sinceLastWrapPoint which represent a pipeline of text since last wrap point. We always iterate through many tokens and always calculating if we can add text since last wrap point to our current line text. You can view this also like this :Supported tags :
<b>, </b>, <i>, </i>, <b><i></i></b>
)<p></p>
)<br>, <br />
<ol><li></li></ol>, <ul><li></li></ul>
)Example
BoxableSample5.pdf