Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9d6a69

Browse files
committed
修复了Quota嵌套相关的问题
1 parent ab41253 commit e9d6a69

File tree

10 files changed

+222
-185
lines changed

10 files changed

+222
-185
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# MarkDown
22

3-
> Android平台的原生Markdown解析器
3+
> Android平台的原生Markdown解析器,已整合进 [RichText](https://github.com/zzhoujay/RichText)
44
5-
Markdown文本直接转换成Spanned,直接设置给TextView即可完成显示
6-
7-
遵循 Github Flavored Markdown 标准 _(如果大家发现有和GFM标准不相符合的地方,欢迎指出)_
5+
* 由markdown文本直接转换为Spanned,快捷高效
6+
* 不依赖特定控件,低侵入性
7+
* 遵循 Github Flavored Markdown 标准
88

99
### 效果展示
1010

@@ -15,7 +15,6 @@ Markdown文本直接转换成Spanned,直接设置给TextView即可完成显示
1515
```
1616
Markdown.fromMarkdown(text,imageGetter,textView);
1717
```
18-
1918
**注意:** 此方法需要在textView的Measure完成后调用,因为需要获取textView的宽高
2019

2120
例子:
@@ -35,27 +34,27 @@ textView.post(new Runnable() {
3534
}
3635
```
3736

38-
### Use in Gradle
37+
### 在RichText中使用
3938

40-
`compile 'com.zzhoujay.markdown:markdown:0.0.3'`
39+
[RichText](https://github.com/zzhoujay/RichText) 包含了一些对图片和其它东西的处理,使用更简单
40+
```
41+
RichText.fromMarkdown(markdown).into(textView);
42+
```
4143

42-
**注意:** 当前并非稳定版,仅供尝鲜使用
44+
### Use in Gradle
4345

44-
### 项目进度
46+
`compile 'com.zzhoujay.markdown:markdown:0.0.4'`
4547

46-
* 已完成大部分功能开发
47-
* 一些细节优化和接口待开发
4848

4949
### 已知问题
5050

51-
* 引用块内不支持Setext-style的标题(后续会想办法修复)
51+
* ~~引用块内不支持Setext-style的标题(后续会想办法修复~~ (已修复)
52+
* 暂不支持使用反斜杠 \\ 转义
5253
* 不支持表格
5354

5455

5556
### 后续计划
5657

57-
* 修复完善当前版本
58-
* 整合进 [RichText](https://github.com/zzhoujay/RichText)
5958
* 修复一些已知问题
6059

6160
_by zzhoujay_

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ dependencies {
2323
compile fileTree(include: ['*.jar'], dir: 'libs')
2424
testCompile 'junit:junit:4.12'
2525
compile 'com.android.support:appcompat-v7:23.4.0'
26-
// compile project(':markdown')
27-
compile 'com.zzhoujay.markdown:markdown:0.0.2'
26+
compile project(':markdown')
27+
// compile 'com.zzhoujay.markdown:markdown:0.0.2'
2828
}

app/src/main/res/raw/mark.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void main()
104104

105105
#### 4.5 强调 ####
106106
在强调内容两侧分别加上`*`或者`_`,如:
107-
> \*斜体\*\_斜体\_
107+
> \*斜体\*\_斜体\_
108108
> \*\*粗体\*\*\_\_粗体\_\_
109109
110110
效果:
@@ -115,7 +115,7 @@ void main()
115115
使用`·``+`、或`-`标记无序列表,如:
116116
> \-(+\*) 第一项
117117
> \-(+\*) 第二项
118-
> \- (+\*)第三项
118+
> \-(+\*)第三项
119119
120120
**注意**:标记后面最少有一个_空格_或_制表符_。若不在引用区块中,必须和前方段落之间存在空行。
121121

app/src/main/res/raw/tt.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,56 @@
1-
title
2-
==
1+
# MarkDown
32

4-
> > hello
5-
> > ==
6-
> > my god
3+
> Android平台的原生Markdown解析器,已整合进 [RichText](https://github.com/zzhoujay/RichText)
4+
5+
* 由markdown文本直接转换为Spanned,快捷高效
6+
* 不依赖特定控件,低侵入性
7+
* 遵循 Github Flavored Markdown 标准
8+
9+
### 使用
10+
11+
```
12+
Markdown.fromMarkdown(text,imageGetter,textView);
13+
```
14+
**注意:** 此方法需要在textView的Measure完成后调用,因为需要获取textView的宽高
15+
16+
例子:
17+
```
18+
textView.post(new Runnable() {
19+
@Override
20+
public void run() {
21+
Spanned spanned = MarkDown.fromMarkdown(stream, new Html.ImageGetter() {
22+
@Override
23+
public Drawable getDrawable(String source) {
24+
Drawable drawable = getResources().getDrawable(R.mipmap.ic_launcher);
25+
drawable.setBounds(0, 0, 400, 400);
26+
return drawable;
27+
}
28+
}, textView);
29+
textView.setText(spanned);
30+
}
31+
```
32+
33+
### 在RichText中使用
34+
35+
[RichText](https://github.com/zzhoujay/RichText) 包含了一些对图片和其它东西的处理,使用更简单
36+
```
37+
RichText.fromMarkdown(markdown).into(textView);
38+
```
39+
40+
### Use in Gradle
41+
42+
`compile 'com.zzhoujay.markdown:markdown:0.0.4'`
43+
44+
45+
### 已知问题
46+
47+
* ~~引用块内不支持Setext-style的标题(后续会想办法修复~~ (已修复)
48+
* 暂不支持使用反斜杠 \\ 转义
49+
* 不支持表格
50+
51+
52+
### 后续计划
53+
54+
* 修复一些已知问题
55+
56+
_by zzhoujay_

image/img1.jpg

47.2 KB
Loading

markdown/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'com.novoda.bintray-release'
33

4-
def version_code = 3
5-
def version_name = '0.0.3'
4+
def version_code = 4
5+
def version_name = '0.0.4'
66

77
android {
88
compileSdkVersion 23

markdown/src/main/java/com/zzhoujay/markdown/MarkDown.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class MarkDown {
1818
public static Spanned fromMarkdown(String source, Html.ImageGetter imageGetter, TextView textView) {
1919
MarkDownParser parser = new MarkDownParser(source, new StyleBuilderImpl(textView, imageGetter));
2020
try {
21-
return parser.parser();
21+
return parser.parse();
2222
} catch (IOException e) {
2323
e.printStackTrace();
2424
}
@@ -28,7 +28,7 @@ public static Spanned fromMarkdown(String source, Html.ImageGetter imageGetter,
2828
public static Spanned fromMarkdown(InputStream inputStream, Html.ImageGetter imageGetter, TextView textView) {
2929
MarkDownParser parser = new MarkDownParser(inputStream, new StyleBuilderImpl(textView, imageGetter));
3030
try {
31-
return parser.parser();
31+
return parser.parse();
3232
} catch (IOException e) {
3333
e.printStackTrace();
3434
}
@@ -38,7 +38,7 @@ public static Spanned fromMarkdown(InputStream inputStream, Html.ImageGetter ima
3838
public static Spanned fromMarkdown(BufferedReader reader, Html.ImageGetter imageGetter, TextView textView) {
3939
MarkDownParser parser = new MarkDownParser(reader, new StyleBuilderImpl(textView, imageGetter));
4040
try {
41-
return parser.parser();
41+
return parser.parse();
4242
} catch (IOException e) {
4343
e.printStackTrace();
4444
}

0 commit comments

Comments
 (0)