Skip to content

Commit 9c8569e

Browse files
authored
Merge branch 'master' into libraries_update
2 parents d919fdf + 46b38a2 commit 9c8569e

File tree

53 files changed

+172
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+172
-102
lines changed

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,35 @@
33
- New Updates also visible here: <https://github.com/gsantner/markor/releases>
44

55

6-
### v2.14 series
6+
### v2.14 -> v2.15
77
- [2.14.0 - 2.14.1](https://github.com/gsantner/markor/compare/v2.14.0...v2.14.1)
88
- [2.14.0 - 2.15.0](https://github.com/gsantner/markor/compare/v2.14.0...v2.15.0)
9+
- Make .svg editable, closes #2647, by @gsantner
10+
- keep the toolbar ref intact (#2635)
11+
- ShareInto: tracking/bloat parameter filtering - Amazon
12+
- Add SHA-256 to file info dialog (#2622)
13+
- Simpler http(s) regex for GsSimpleMarkdownParser (PR #2606)
14+
- Add dyslexia friendly font (PR #2602)
15+
- Improving view mode and rendering (PR #2566)
16+
- Fixes and improvements for AsciiDoc (darklight, caution-admonition, linebreak, pagebreak, quote, attachment) (#2597)
17+
- Improve PlaintextSyntaxHighlighter with basic programming language editor syntax highlighting (PR #2560)
18+
- Update README.md (PR #2595)
19+
- Add AsciiDoc-reference, toolbar swap view and save button (#2580) (#2579)
20+
- Upgrade to mermaid v11.6.0 (PR #2575)
21+
- Template: Mermaid-Katex improvements (PR #2574)
22+
- Settings: Move some 'Other' settings to 'Edit mode' (PR #2562)
23+
- Quick filter all files, Share files into markor (PR #2521)
24+
- Fix Prism code block issues (PR #2542)
25+
- Fix unit tests - Color.rgb is Android only API and not available in junit -> own method
26+
- CSV: View-Mode syntax highlighting: Make column 3 readable in dark mode (255 blue -> violet-blue), closes #2540, by @gsantner
27+
- OrgMode: make insert-link action-button use correct syntax, closes #2527 (#2528)
28+
- Improve text rendering performance, closes #2478, closes #2515 (#2509)
29+
- Filebrowser: Per folder sort order (PR #2499)
30+
- Improve line numbers (PR #2470)
31+
- Orgmode fixes and improvements, closes #2405 (PR #2504)
32+
- View-Mode: Code highlighting block - Prism add more language (PR #2508)
33+
- Markdown: Open link action: Fix open links when Markdown link has space at end
34+
- Update Android gradle/tools to 8.10.2/8.8
935

1036
### v2.13 series
1137
- [2.13.0 - 2.14.0](https://github.com/gsantner/markor/compare/v2.13.0...v2.14.0)

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ Files are stored locally in a user selectable folder, defaulting to the internal
169169
In user-generated content data can be loaded from the internet.
170170
* INSTALL_SHORTCUT
171171
Install a shortcut to launchers to open a file/folder in Markor.
172-
* RECORD_AUDIO
173-
Attach voice notes to the text. The permission is only used after click on the "attach audio" button, at the audio record dialog. Audio recording is always started and stopped manually by you (button press).
174172

175173
## License
176174
The code of the app is licensed Apache 2.0.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
defaultConfig {
2424
resValue "string", "manifest_package_id", "net.gsantner.markor"
2525
applicationId "net.gsantner.markor"
26-
versionName "2.14.1"
27-
versionCode 158
26+
versionName "2.15.1"
27+
versionCode 160
2828

2929
multiDexEnabled true
3030
minSdkVersion rootProject.ext.version_minSdk

app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,12 @@ private void addDocumentToPrefgroup(String filepath, final PreferenceGroup prefG
582582
}
583583

584584
private static String sanitize(final String link) {
585-
return link.replaceAll("(?m)(?<=&|\\?)(utm_|source|si|__mk_|ref|sprefix|crid|partner|promo|ad_sub|gclid|fbclid|msclkid).*?(&|$|\\s|\\))", "");
585+
String dropGetParams = "utm_|source|si|__mk_|ref|sprefix|crid|partner|promo|ad_sub|gclid|fbclid|msclkid|dib";
586+
if (link.contains("amazon.")) {
587+
dropGetParams += "|qid|sr";
588+
}
589+
590+
return link.replaceAll("(?m)(?<=&|\\?)(" + dropGetParams + ").*?(&|$|\\s|\\))", "");
586591
}
587592

588593
private static String extractShareText(final Intent intent) {

app/src/main/java/net/gsantner/markor/activity/SettingsActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static class RESULT {
5858

5959
protected Toolbar toolbar;
6060

61+
@Override
6162
public void onCreate(Bundle b) {
6263
// Must be applied before setContentView
6364
super.onCreate(b);

app/src/main/java/net/gsantner/markor/format/binary/EmbedBinaryTextConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
public class EmbedBinaryTextConverter extends TextConverterBase {
2727
private static final List<String> EXT = new ArrayList<>();
2828
private static final List<String> EXT_AUDIO = Arrays.asList(".mp3", ".ogg", ".flac", ".opus", ".oga", ".wma", ".m4a", ".aac", ".wav", ".amr", ".mid", ".midi", ".pcm");
29-
private static final List<String> EXT_IMAGE = Arrays.asList(".jpg", ".jpeg", ".png", ".bmp", ".gif", ".webp", ".svg", ".heic", ".heif", ".avif");
29+
private static final List<String> EXT_IMAGE = Arrays.asList(".jpg", ".jpeg", ".png", ".bmp", ".gif", ".webp", ".heic", ".heif", ".avif");
3030
private static final List<String> EXT_VIDEO = Arrays.asList(".webm", ".mp4", ".mpeg4", ".mpeg", ".mpg", ".mkv", ".3gp", ".ts", ".m4v");
3131

3232
public static final String EXT_MATCHES_M3U_PLAYLIST = "(?i).m3u8?";
33+
public static final String EXT_IMAGE_TEXTUAL = "(?i).svg";
3334

3435
private static final String HTML100_BODY_BEGIN = "<div>\n ";
3536
private static final String HTML101_BODY_END = "\n\n</div>";
@@ -63,7 +64,7 @@ public String convertMarkup(String markup, Context context, boolean lightMode, b
6364
// Sticky header with content depending on type
6465
if (true) {
6566
converted += "\n<div class='sticky sticky-blackbox'>\n";
66-
if (EXT_IMAGE.contains(extWithDot)) {
67+
if (EXT_IMAGE.contains(extWithDot) || extWithDot.matches(EXT_IMAGE_TEXTUAL)) {
6768
converted += "<img class='' src='" + TOKEN_FILEURI_VIEWED_FILE + "' alt='Your Android device does not support the file format.'/>";
6869
} else if (EXT_VIDEO.contains(extWithDot) || extWithDot.matches(EXT_MATCHES_M3U_PLAYLIST)) {
6970
converted += "<video class='htmlav' autoplay controls loop style='max-height: 45vh; width: 100%; max-width: 100%;' srcx='" + TOKEN_FILEURI_VIEWED_FILE + "'/>Your Android device does not support the video tag or the file format.</video>";

app/src/main/java/net/gsantner/markor/format/plaintext/PlaintextTextConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class PlaintextTextConverter extends TextConverterBase {
3030
private static final String HTML100_BODY_PRE_BEGIN = "<pre style='white-space: pre-wrap;font-family: " + TOKEN_FONT + "' >";
3131
private static final String HTML101_BODY_PRE_END = "</pre>";
32-
private static final List<String> EXT_TEXT = Arrays.asList(".txt", ".taskpaper", ".org", ".ldg", ".ledger", ".m3u", ".m3u8", ".lrc", ".fen");
32+
private static final List<String> EXT_TEXT = Arrays.asList(".txt", ".taskpaper", ".org", ".ldg", ".ledger", ".m3u", ".m3u8", ".svg", ".lrc", ".fen");
3333
private static final List<String> EXT_HTML = Arrays.asList(".html", ".htm");
3434
private static final List<String> EXT_CODE_HL = Arrays.asList(".py", ".cpp", ".h", ".c", ".js", ".mjs", ".css", ".cs", ".kt", ".lua", ".perl", ".java", ".qml", ".diff", ".php", ".r", ".patch", ".rs", ".swift", ".ts", ".mm", ".go", ".sh", ".rb", ".tex", ".xml", ".xlf");
3535
private static final List<String> EXT = new ArrayList<>();
@@ -64,7 +64,7 @@ public String convertMarkup(String markup, Context context, boolean lightMode, b
6464
if (EXT_HTML.contains(extWithDot)) {
6565
// HTML: Display it
6666
converted += markup;
67-
} else if (extWithDot.matches(EmbedBinaryTextConverter.EXT_MATCHES_M3U_PLAYLIST)) {
67+
} else if (extWithDot.matches(EmbedBinaryTextConverter.EXT_MATCHES_M3U_PLAYLIST) || extWithDot.matches(EmbedBinaryTextConverter.EXT_IMAGE_TEXTUAL)) {
6868
// Playlist: Load in Embed-Binary view-mode
6969
return FormatRegistry.CONVERTER_EMBEDBINARY.convertMarkup(markup, context, lightMode, lineNum, file);
7070
} else if (EXT_CODE_HL.contains(extWithDot) || (this instanceof KeyValueTextConverter)) {

app/src/main/java/net/gsantner/markor/frontend/AttachLinkOrFileDialog.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public static void showInsertImageOrLinkDialog(
101101
final Button buttonPictureGallery = view.findViewById(R.id.ui__select_path_dialog__gallery_picture);
102102
final Button buttonPictureCamera = view.findViewById(R.id.ui__select_path_dialog__camera_picture);
103103
final Button buttonPictureEdit = view.findViewById(R.id.ui__select_path_dialog__edit_picture);
104-
final Button buttonAudioRecord = view.findViewById(R.id.ui__select_path_dialog__record_audio);
105104

106105
builder.setCancelable(true);
107106
builder.setNegativeButton(android.R.string.cancel, (di, b) -> di.dismiss());
@@ -142,7 +141,6 @@ public static void showInsertImageOrLinkDialog(
142141
okType = InsertType.IMAGE_DIALOG;
143142
} else if (action == AUDIO_ACTION) {
144143
dialog.setTitle(R.string.audio);
145-
buttonAudioRecord.setVisibility(View.VISIBLE);
146144
browseType = InsertType.AUDIO_BROWSE;
147145
okType = InsertType.AUDIO_DIALOG;
148146
} else {
@@ -158,7 +156,6 @@ public static void showInsertImageOrLinkDialog(
158156
buttonSearch.setOnClickListener(v -> _insertItem.callback(InsertType.LINK_SEARCH));
159157
buttonPictureCamera.setOnClickListener(b -> _insertItem.callback(InsertType.IMAGE_CAMERA));
160158
buttonPictureGallery.setOnClickListener(v -> _insertItem.callback(InsertType.IMAGE_GALLERY));
161-
buttonAudioRecord.setOnClickListener(v -> _insertItem.callback(InsertType.AUDIO_RECORDING));
162159
buttonPictureEdit.setOnClickListener(v -> _insertItem.callback(InsertType.IMAGE_EDIT));
163160

164161
dialog.show();

app/src/main/java/net/gsantner/markor/frontend/FileInfoDialog.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,17 @@ private AlertDialog.Builder setUpDialog(final File file, LayoutInflater inflater
8585
tv(root, R.id.ui__fileinfodialog__last_modified_caption).setText(getString(R.string.last_modified_witharg, "").replace(":", "").trim());
8686
tv(root, R.id.ui__fileinfodialog__size_description).setText(GsFileUtils.getReadableFileSize(file.length(), false));
8787
tv(root, R.id.ui__fileinfodialog__mimetype_description).setText(GsFileUtils.getMimeType(file));
88+
tv(root, R.id.ui__fileinfodialog__sha_256).setText(GsFileUtils.sha256(file));
8889
tv(root, R.id.ui__fileinfodialog__location).setOnLongClickListener(v -> {
8990
GsContextUtils.instance.setClipboard(v.getContext(), file.getAbsolutePath());
9091
Toast.makeText(v.getContext(), R.string.clipboard, Toast.LENGTH_SHORT).show();
91-
return true;
92-
});
92+
return true;}
93+
);
94+
tv(root, R.id.ui__fileinfodialog__sha_256).setOnLongClickListener(v -> {
95+
GsContextUtils.instance.setClipboard(v.getContext(), GsFileUtils.sha256(file));
96+
Toast.makeText(v.getContext(), R.string.clipboard, Toast.LENGTH_SHORT).show();
97+
return true;}
98+
);
9399

94100

95101
// Number of lines and character count only apply for files.
@@ -117,6 +123,11 @@ private AlertDialog.Builder setUpDialog(final File file, LayoutInflater inflater
117123
checkHideInRecents.setChecked(appSettings.listFileInRecents(file));
118124
checkHideInRecents.setOnCheckedChangeListener((buttonView, isChecked) -> appSettings.setListFileInRecents(file, isChecked));
119125

126+
127+
CheckBox checkFavorite = root.findViewById(R.id.ui__fileinfodialog__favorite);
128+
checkFavorite.setChecked(appSettings.getFavouriteFiles().contains(file));
129+
checkFavorite.setOnCheckedChangeListener((buttonView, isChecked) -> appSettings.toggleFavouriteFile(file));
130+
120131
return dialogBuilder;
121132
}
122133

app/src/main/java/net/gsantner/opoc/format/GsSimpleMarkdownParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public String filter(String text) {
6161
.replaceAll("(?m)^# (.*)$", "<br/><big><big><big><b><font color='#000000'>$1</font></b></big></big></big><br/><br/>") // h1 (DEP: h2,h3)
6262
.replaceAll("!\\[(.*?)\\]\\((.*?)\\)", "<a href=\\'$2\\'>$1</a>") // img
6363
.replaceAll("\\[(.*?)\\]\\((.*?)\\)", "<a href=\\'$2\\'>$1</a>") // a href (DEP: img)
64-
.replaceAll("<(http|https):\\/\\/(.*)>", "<a href='$1://$2'>$1://$2</a>") // a href (DEP: img)
64+
.replaceAll("<http(s?):\\/\\/(.*)>", "<a href='http$1://$2'>$1://$2</a>") // a href (DEP: img)
6565
.replaceAll("(?m)^([-*] )(.*)$", "<font color='#000001'>&#8226;</font> $2<br/>") // unordered list + end line
6666
.replaceAll("(?m)^ (-|\\*) ([^<]*)$", "&nbsp;&nbsp;<font color='#000001'>&#8226;</font> $2<br/>") // unordered list2 + end line
6767
.replaceAll("`([^<]*)`", "<font face='monospace'>$1</font>") // code
@@ -90,7 +90,7 @@ public String filter(String text) {
9090
.replaceAll("(?m)^## (.*)$", "<h2>$1</h2>") /// h2 (DEP: h3)
9191
.replaceAll("(?m)^# (.*)$", "<h1>$1</h1>") // h1 (DEP: h2,h3)
9292
.replaceAll("!\\[(.*?)\\]\\((.*?)\\)", "<img src=\\'$2\\' alt='$1' />") // img
93-
.replaceAll("<(http|https):\\/\\/(.*)>", "<a href='$1://$2'>$1://$2</a>") // a href (DEP: img)
93+
.replaceAll("<http(s?):\\/\\/(.*)>", "<a href='http$1://$2'>$1://$2</a>") // a href (DEP: img)
9494
.replaceAll("\\[(.*?)\\]\\((.*?)\\)", "<a href=\\'$2\\'>$1</a>") // a href (DEP: img)
9595
.replaceAll("(?m)^[-*] (.*)$", "<font color='#000001'>&#8226;</font> $1 ") // unordered list + end line
9696
.replaceAll("(?m)^ [-*] (.*)$", "&nbsp;&nbsp;<font color='#000001'>&#8226;</font> $1 ") // unordered list2 + end line

0 commit comments

Comments
 (0)