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

[Workflow] display label with new lines + colours properly when rendering a PUML dump #49516

Conversation

alexislefebvre
Copy link
Contributor

@alexislefebvre alexislefebvre commented Feb 23, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #49311
License MIT
Doc PR no

In #49272 I removed the new lines instead of formatting them properly.

The PUML format accept new lines in labels of transitions as long as the source file uses actual \n strings instead of line returns (like PHP_EOL).

I propose a novel approach that will handle new lines with or without colours.

Compare these outputs from plantuml.com, inputs are based on the fixtures from Symfony:

After #49272

New lines are ignored

image

(source)

Correct output from this PR

With this patch → the second line is Grey and no tag is visible

image

(source)


Why close and open <font> tags?

The output is broken if we use \n without taking into account the <font> tags → there is a second line but it is black and </font> is visible

image

(source)

@carsonbot carsonbot added this to the 5.4 milestone Feb 23, 2023
@alexislefebvre alexislefebvre force-pushed the 5.4-fix-style-of-label-containing-new-lines-in-puml-dump branch from a3edf88 to c363a64 Compare February 23, 2023 19:21
@alexislefebvre alexislefebvre force-pushed the 5.4-fix-style-of-label-containing-new-lines-in-puml-dump branch from c363a64 to d0da385 Compare February 23, 2023 21:01
lyrixx
lyrixx approved these changes Feb 23, 2023
@alexislefebvre alexislefebvre changed the title fix style of label containing new lines in PUML dump display label containing new lines properly when rendering a PUML dump Feb 23, 2023
@alexislefebvre alexislefebvre changed the title display label containing new lines properly when rendering a PUML dump display label with new lines + colours properly when rendering a PUML dump Feb 23, 2023
@carsonbot carsonbot changed the title display label with new lines + colours properly when rendering a PUML dump [Workflow] display label with new lines + colours properly when rendering a PUML dump Feb 24, 2023
@nicolas-grekas nicolas-grekas force-pushed the 5.4-fix-style-of-label-containing-new-lines-in-puml-dump branch from d0da385 to 361dce2 Compare February 24, 2023 08:13
@nicolas-grekas
Copy link
Member

Thank you @alexislefebvre.

@nicolas-grekas nicolas-grekas merged commit 5bc4d55 into symfony:5.4 Feb 24, 2023
9 of 11 checks passed
@alexislefebvre alexislefebvre deleted the 5.4-fix-style-of-label-containing-new-lines-in-puml-dump branch February 24, 2023 08:38
This was referenced Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants