[vlc-devel] [PATCH] macosx: Parse HTML descriptions in addons manager
Felix Paul Kühne
fkuehne at videolan.org
Thu Jul 7 11:47:55 CEST 2016
Hey Marvin,
> On 07 Jul 2016, at 03:32, Marvin Scholz <epirat07 at gmail.com> wrote:
>
> With this commit, HTML descriptions in the addons manager
> are parsed correctly and formatting is applied using a
> NSAttributedString and a little bit of CSS to make it use
> the system font.
> ---
> modules/gui/macosx/AddonsWindowController.m | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/modules/gui/macosx/AddonsWindowController.m b/modules/gui/macosx/AddonsWindowController.m
> index b770a32..fc23748 100644
> --- a/modules/gui/macosx/AddonsWindowController.m
> +++ b/modules/gui/macosx/AddonsWindowController.m
> @@ -205,7 +205,14 @@ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification
> [_name setStringValue:[currentItem name]];
> [_author setStringValue:[currentItem author]];
> [_version setStringValue:[currentItem version]];
> - [_description setString:[currentItem description]];
> +
> + // Parse HTML description properly
> + NSMutableString *htmlDescription = [NSMutableString stringWithString:@"<style>body{ font-family: -apple-system-body, -apple-system, HelveticaNeue, Arial, sans-serif; }</style>"];
> + [htmlDescription appendString:[currentItem description]];
a stringWithFormat on initialization with the currentItem’s description being directly added would save 1 memcpy of the entire string.
Rest LGTM. Please push then :)
Best regards,
Felix
More information about the vlc-devel
mailing list