-
Notifications
You must be signed in to change notification settings - Fork 56
Markdown in Descriptions #129
Markdown in Descriptions #129
Conversation
Need to update descriptionColumnParser tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
public String fixHtmlEscapes(String input) { | ||
//noinspection deprecation | ||
return Html.fromHtml(input).toString(); | ||
} | ||
|
||
public String convertStringToHtml(String string) { | ||
// Converts link markdown to HTML | ||
String output = string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the extra variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure actually, I thought it would help with clarity to make it obvious that the string coming out was different, though I guess it's not really necessary
|
||
public String convertSubredditsToLinks(String string) { | ||
// Converts subreddit mentions to links in HTML | ||
String output = string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, why the extra variable
description.setText(appInfo.getDescription()); | ||
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | ||
description.setText(Html.fromHtml(appInfo.getDescription(), Html.FROM_HTML_MODE_COMPACT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF without brackets -> all one the same.
I don't always do it myself but it is a good practice for code reviews.
AppInfo app3 = new AppInfo(); | ||
app3.setAppName("Markdown Test"); | ||
app3.setDescription( | ||
encodingFixer.convertStringToHtml("Tutorial **screencast** for [Propellerheads Reason](https://www.propellerheads.se/products/reason/)")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a call is this long, and a line break is necessary maybe make it:
app3.setDescription(
encodingFixer.convertStringToHtml("Tutorial **screencast** for [Propellerheads Reason](https://www.propellerheads.se/products/reason/)")
);
* Convert bold and link markdown to HTML equivalents (handled by EncodingFixer) * Subreddit mentions (eg "/r/Android") are converted to HTML links * Support for HTML app descriptions in App Details view and App List view * Clickable links in app details view * Unit tests for changes, updates to other tests and mocks
Issues
#8 - Deal with markdown in descriptions
Changes
EncodingFixer
)