Skip to content

Commit

Permalink
Merge branch 'main' into @Skalakid/fix-emoji-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Nov 13, 2024
2 parents 417ba57 + c352064 commit ee7174a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ jobs:

- name: Build app
working-directory: example
run: npx react-native@latest run-ios --no-packager
run: npx react-native run-ios --no-packager
15 changes: 6 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ android {

packagingOptions {
doNotStrip '**/**/*.so'
// For some reason gradle only complains about the duplicated version of librrc_root and libreact_render libraries
// while there are more libraries copied in intermediates folder of the lib build directory, we exclude
// only the ones that make the build fail (ideally we should only include libreanimated but we
// are only allowed to specify exclude patterns)
excludes = [
"META-INF",
"META-INF/**",
Expand All @@ -152,17 +156,10 @@ android {
"**/libjsi.so",
"**/libreactnativejni.so",
"**/libreactnative.so",
"**/libreact_render*.so",
"**/librrc_root.so",
]
}

packagingOptions {
// For some reason gradle only complains about the duplicated version of librrc_root and libreact_render libraries
// while there are more libraries copied in intermediates folder of the lib build directory, we exclude
// only the ones that make the build fail (ideally we should only include libreanimated but we
// are only allowed to specify exlude patterns)
exclude "**/libreact_render*.so"
exclude "**/librrc_root.so"
}
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import android.text.style.AbsoluteSizeSpan;

import com.facebook.react.uimanager.PixelUtil;

public class MarkdownEmojiSpan extends AbsoluteSizeSpan implements MarkdownSpan {
public MarkdownEmojiSpan(float fontSize) {
super((int) fontSize, true);
super((int) PixelUtil.toPixelFromDIP(fontSize), false);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@expensify/react-native-live-markdown",
"version": "0.1.180",
"version": "0.1.184",
"description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
5 changes: 5 additions & 0 deletions parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import ExpensiMark from 'expensify-common/dist/ExpensiMark';
import {unescapeText} from './utils';

const MAX_PARSABLE_LENGTH = 4000;

type MarkdownType =
| 'bold'
| 'italic'
Expand Down Expand Up @@ -274,6 +276,9 @@ function groupRanges(ranges: MarkdownRange[]) {
}

function parseExpensiMarkToRanges(markdown: string): MarkdownRange[] {
if (markdown.length > MAX_PARSABLE_LENGTH) {
return [];
}
try {
const html = parseMarkdownToHTML(markdown);
const tokens = parseHTMLToTokens(html);
Expand Down
18 changes: 9 additions & 9 deletions parser/react-native-live-markdown-parser.js

Large diffs are not rendered by default.

0 comments on commit ee7174a

Please sign in to comment.