cmy 14 tuntia sitten
vanhempi
commit
fde3adc3e1
46 muutettua tiedostoa jossa 521 lisäystä ja 2766 poistoa
  1. 0 1
      components/mpvue-citypicker/mpvueCityPicker.nvue
  2. 0 27
      components/u-parse/components/wxParseAudio.vue
  3. 0 86
      components/u-parse/components/wxParseImg.vue
  4. 0 107
      components/u-parse/components/wxParseTemplate0.vue
  5. 0 99
      components/u-parse/components/wxParseTemplate1.vue
  6. 0 97
      components/u-parse/components/wxParseTemplate10.vue
  7. 0 87
      components/u-parse/components/wxParseTemplate11.vue
  8. 0 98
      components/u-parse/components/wxParseTemplate2.vue
  9. 0 98
      components/u-parse/components/wxParseTemplate3.vue
  10. 0 98
      components/u-parse/components/wxParseTemplate4.vue
  11. 0 98
      components/u-parse/components/wxParseTemplate5.vue
  12. 0 98
      components/u-parse/components/wxParseTemplate6.vue
  13. 0 98
      components/u-parse/components/wxParseTemplate7.vue
  14. 0 98
      components/u-parse/components/wxParseTemplate8.vue
  15. 0 98
      components/u-parse/components/wxParseTemplate9.vue
  16. 0 15
      components/u-parse/components/wxParseVideo.vue
  17. 0 261
      components/u-parse/libs/html2json.js
  18. 0 156
      components/u-parse/libs/htmlparser.js
  19. 0 195
      components/u-parse/libs/wxDiscode.js
  20. 0 102
      components/u-parse/readme.md
  21. 0 232
      components/u-parse/u-parse.css
  22. 0 118
      components/u-parse/u-parse.vue
  23. 7 9
      pages/guild/itemIndex.vue
  24. 1 1
      pages/index/index.nvue
  25. 2 1
      pages/index/index.vue
  26. 1 1
      pages/news/about.vue
  27. 1 1
      pages/news/index.vue
  28. 1 1
      pages/operation/agreement.vue
  29. 1 1
      pages/operation/cancellation.vue
  30. 1 1
      pages/operation/package.vue
  31. 1 1
      pages/operation/user.vue
  32. 194 0
      uni_modules/mp-html/README.md
  33. 150 0
      uni_modules/mp-html/changelog.md
  34. 4 5
      uni_modules/mp-html/components/mp-html/mp-html.vue
  35. 17 7
      uni_modules/mp-html/components/mp-html/node/node.vue
  36. 63 5
      uni_modules/mp-html/components/mp-html/parser.js
  37. 76 0
      uni_modules/mp-html/package.json
  38. 0 0
      uni_modules/mp-html/static/app-plus/mp-html/js/handler.js
  39. 0 0
      uni_modules/mp-html/static/app-plus/mp-html/js/uni.webview.min.js
  40. 1 0
      uni_modules/mp-html/static/app-plus/mp-html/local.html
  41. 0 13
      uni_modules/uv-parse/changelog.md
  42. 0 87
      uni_modules/uv-parse/package.json
  43. 0 21
      uni_modules/uv-parse/readme.md
  44. 0 224
      uni_modules/uv-parse/static/app-plus/uv-parse/js/handler.js
  45. 0 19
      uni_modules/uv-parse/static/app-plus/uv-parse/js/uni.webview.min.js
  46. 0 1
      uni_modules/uv-parse/static/app-plus/uv-parse/local.html

+ 0 - 1
components/mpvue-citypicker/mpvueCityPicker.nvue

@@ -168,7 +168,6 @@
 		margin-top: 20rpx;
 	}
 	.picker-item {
-		border: 1px soli #000;
 		height: 100rpx;
 		text-overflow: ellipsis;
 		lines:1;

+ 0 - 27
components/u-parse/components/wxParseAudio.vue

@@ -1,27 +0,0 @@
-<template>
-  <!--增加audio标签支持-->
-  <audio
-    :id="node.attr.id"
-    :class="node.classStr"
-    :style="node.styleStr"
-    :src="node.attr.src"
-    :loop="node.attr.loop"
-    :poster="node.attr.poster"
-    :name="node.attr.name"
-    :author="node.attr.author"
-    controls></audio>
-</template>
-
-<script>
-export default {
-  name: 'wxParseAudio',
-  props: {
-    node: {
-      type: Object,
-      default() {
-        return {};
-      },
-    },
-  },
-};
-</script>

+ 0 - 86
components/u-parse/components/wxParseImg.vue

@@ -1,86 +0,0 @@
-<template>
-  <image
-    :mode="node.attr.mode"
-    :lazy-load="node.attr.lazyLoad"
-    :class="node.classStr"
-    :style="newStyleStr || node.styleStr"
-    :data-src="node.attr.src"
-    :src="node.attr.src"
-    @tap="wxParseImgTap"
-    @load="wxParseImgLoad"
-    />
-</template>
-
-<script>
-export default {
-  name: 'wxParseImg',
-  data() {
-    return {
-      newStyleStr: '',
-      preview: true,
-    };
-  },
-  props: {
-    node: {
-      type: Object,
-      default() {
-        return {};
-      },
-    },
-  },
-  methods: {
-    wxParseImgTap(e) {
-      if (!this.preview) return;
-      const { src } = e.currentTarget.dataset;
-      if (!src) return;
-      let parent = this.$parent;
-      while(!parent.preview || typeof parent.preview !== 'function') {// TODO 遍历获取父节点执行方法
-      	parent = parent.$parent;
-      }
-      parent.preview(src, e);
-    },
-    // 图片视觉宽高计算函数区
-    wxParseImgLoad(e) {
-      const { src } = e.currentTarget.dataset;
-      if (!src) return;
-      const { width, height } = e.mp.detail;
-      const recal = this.wxAutoImageCal(width, height);
-      const { imageheight, imageWidth } = recal;
-      const { padding, mode } = this.node.attr;
-      const { styleStr } = this.node;
-      const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px;`;
-      this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`;
-    },
-    // 计算视觉优先的图片宽高
-    wxAutoImageCal(originalWidth, originalHeight) {
-      // 获取图片的原始长宽
-      const { padding } = this.node.attr;
-      const windowWidth = this.node.$screen.width - (2 * padding);
-      const results = {};
-
-      if (originalWidth < 60 || originalHeight < 60) {
-        const { src } = this.node.attr;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.removeImageUrl(src);
-        this.preview = false;
-      }
-
-      // 判断按照那种方式进行缩放
-      if (originalWidth > windowWidth) {
-        // 在图片width大于手机屏幕width时候
-        results.imageWidth = windowWidth;
-        results.imageheight = windowWidth * (originalHeight / originalWidth);
-      } else {
-        // 否则展示原来的数据
-        results.imageWidth = originalWidth;
-        results.imageheight = originalHeight;
-      }
-
-      return results;
-    },
-  },
-};
-</script>

+ 0 - 107
components/u-parse/components/wxParseTemplate0.vue

@@ -1,107 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--table类型-->
-			<block v-else-if="node.tag == 'table'">
-				<view :class="node.classStr" class="table" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate1';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate0',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;// TODO currentTarget才有dataset
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {// TODO 遍历获取父节点执行方法
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 99
components/u-parse/components/wxParseTemplate1.vue

@@ -1,99 +0,0 @@
-<template>
-	<view :class="(node.tag == 'li' ? node.classStr : (node.node==='text'?'text':''))">
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<!-- <view :class="node.classStr" :style="node.styleStr"> -->
-				<view :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate2';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate1',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 97
components/u-parse/components/wxParseTemplate10.vue

@@ -1,97 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate11';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate10',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 87
components/u-parse/components/wxParseTemplate11.vue

@@ -1,87 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<!--button类型-->
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					{{node.text}}
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					{{node.text}}
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					{{node.text}}
-				</view>
-			</block>
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate11',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate2.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate3';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate2',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate3.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate4';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate3',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate4.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate5';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate4',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate5.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate6';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate5',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate6.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate7';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate6',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate7.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate8';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate7',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate8.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate9';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate8',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 98
components/u-parse/components/wxParseTemplate9.vue

@@ -1,98 +0,0 @@
-<template>
-	<view>
-		<!--判断是否是标签节点-->
-		<block v-if="node.node == 'element'">
-			<block v-if="node.tag == 'button'">
-				<button type="default" size="mini">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</button>
-			</block>
-
-			<!--li类型-->
-			<block v-else-if="node.tag == 'li'">
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--video类型-->
-			<block v-else-if="node.tag == 'video'">
-				<wx-parse-video :node="node" />
-			</block>
-
-			<!--audio类型-->
-			<block v-else-if="node.tag == 'audio'">
-				<wx-parse-audio :node="node" />
-			</block>
-
-			<!--img类型-->
-			<block v-else-if="node.tag == 'img'">
-				<wx-parse-img :node="node" />
-			</block>
-
-			<!--a类型-->
-			<block v-else-if="node.tag == 'a'">
-				<view @click="wxParseATap" :class="node.classStr" :data-href="node.attr.href" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-			<!--br类型-->
-			<block v-else-if="node.tag == 'br'">
-				<text>\n</text>
-			</block>
-
-			<!--其他标签-->
-			<block v-else>
-				<view :class="node.classStr" :style="node.styleStr">
-					<block v-for="(node, index) of node.nodes" :key="index">
-						<wx-parse-template :node="node" />
-					</block>
-				</view>
-			</block>
-
-		</block>
-
-		<!--判断是否是文本节点-->
-		<block v-else-if="node.node == 'text'">{{node.text}}</block>
-	</view>
-</template>
-
-<script>
-	import wxParseTemplate from './wxParseTemplate10';
-	import wxParseImg from './wxParseImg';
-	import wxParseVideo from './wxParseVideo';
-	import wxParseAudio from './wxParseAudio';
-
-	export default {
-		name: 'wxParseTemplate9',
-		props: {
-			node: {},
-		},
-		components: {
-			wxParseTemplate,
-			wxParseImg,
-			wxParseVideo,
-			wxParseAudio,
-		},
-		methods: {
-			wxParseATap(e) {
-				const {
-					href
-				} = e.currentTarget.dataset;
-				if (!href) return;
-				let parent = this.$parent;
-				while(!parent.preview || typeof parent.preview !== 'function') {
-					parent = parent.$parent;
-				}
-				parent.navigate(href, e);
-			},
-		},
-	};
-</script>

+ 0 - 15
components/u-parse/components/wxParseVideo.vue

@@ -1,15 +0,0 @@
-<template>
-  <!--增加video标签支持,并循环添加-->
-  <view :class="node.classStr" :style="node.styleStr">
-    <video :class="node.classStr" class="video-video" :src="node.attr.src"></video>
-  </view>
-</template>
-
-<script>
-export default {
-  name: 'wxParseVideo',
-  props: {
-    node: {},
-  },
-};
-</script>

+ 0 - 261
components/u-parse/libs/html2json.js

@@ -1,261 +0,0 @@
-/**
- * html2Json 改造来自: https://github.com/Jxck/html2json
- *
- *
- * author: Di (微信小程序开发工程师)
- * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
- *               垂直微信小程序开发交流社区
- *
- * github地址: https://github.com/icindy/wxParse
- *
- * for: 微信小程序富文本解析
- * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
- */
-
-import wxDiscode from './wxDiscode';
-import HTMLParser from './htmlparser';
-
-function makeMap(str) {
-  const obj = {};
-  const items = str.split(',');
-  for (let i = 0; i < items.length; i += 1) obj[items[i]] = true;
-  return obj;
-}
-
-// Block Elements - HTML 5
-const block = makeMap('br,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
-
-// Inline Elements - HTML 5
-const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
-
-// Elements that you can, intentionally, leave open
-// (and which close themselves)
-const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr');
-
-function removeDOCTYPE(html) {
-  const isDocument = /<body.*>([^]*)<\/body>/.test(html);
-  return isDocument ? RegExp.$1 : html;
-}
-
-function trimHtml(html) {
-  return html
-    .replace(/<!--.*?-->/gi, '')
-    .replace(/\/\*.*?\*\//gi, '')
-    .replace(/[ ]+</gi, '<')
-    .replace(/<script[^]*<\/script>/gi, '')
-    .replace(/<style[^]*<\/style>/gi, '');
-}
-
-function getScreenInfo() {
-  const screen = {};
-  wx.getSystemInfo({
-    success: (res) => {
-      screen.width = res.windowWidth;
-      screen.height = res.windowHeight;
-    },
-  });
-  return screen;
-}
-
-function html2json(html, customHandler, imageProp, host) {
-  // 处理字符串
-  html = removeDOCTYPE(html);
-  html = trimHtml(html);
-  html = wxDiscode.strDiscode(html);
-  // 生成node节点
-  const bufArray = [];
-  const results = {
-    nodes: [],
-    imageUrls: [],
-  };
-
-	const screen = getScreenInfo();
-  function Node(tag) {
-    this.node = 'element';
-    this.tag = tag;
-		
-		this.$screen = screen;
-  }
-
-  HTMLParser(html, {
-    start(tag, attrs, unary) {
-      // node for this element
-      const node = new Node(tag);
-
-      if (bufArray.length !== 0) {
-        const parent = bufArray[0];
-        if (parent.nodes === undefined) {
-          parent.nodes = [];
-        }
-      }
-
-      if (block[tag]) {
-        node.tagType = 'block';
-      } else if (inline[tag]) {
-        node.tagType = 'inline';
-      } else if (closeSelf[tag]) {
-        node.tagType = 'closeSelf';
-      }
-
-      node.attr = attrs.reduce((pre, attr) => {
-        const { name } = attr;
-        let { value } = attr;
-        if (name === 'class') {
-          node.classStr = value;
-        }
-        // has multi attibutes
-        // make it array of attribute
-        if (name === 'style') {
-          node.styleStr = value;
-        }
-        if (value.match(/ /)) {
-          value = value.split(' ');
-        }
-
-        // if attr already exists
-        // merge it
-        if (pre[name]) {
-          if (Array.isArray(pre[name])) {
-            // already array, push to last
-            pre[name].push(value);
-          } else {
-            // single value, make it array
-            pre[name] = [pre[name], value];
-          }
-        } else {
-          // not exist, put it
-          pre[name] = value;
-        }
-
-        return pre;
-      }, {});
-
-      // 优化样式相关属性
-      if (node.classStr) {
-        node.classStr += ` ${node.tag}`;
-      } else {
-        node.classStr = node.tag;
-      }
-      if (node.tagType === 'inline') {
-        node.classStr += ' inline';
-      }
-
-      // 对img添加额外数据
-      if (node.tag === 'img') {
-        let imgUrl = node.attr.src;
-        imgUrl = wxDiscode.urlToHttpUrl(imgUrl, imageProp.domain);
-        Object.assign(node.attr, imageProp, {
-          src: imgUrl || '',
-        });
-        if (imgUrl) {
-          results.imageUrls.push(imgUrl);
-        }
-      }
-
-      // 处理a标签属性
-      if (node.tag === 'a') {
-        node.attr.href = node.attr.href || '';
-      }
-
-      // 处理font标签样式属性
-      if (node.tag === 'font') {
-        const fontSize = [
-          'x-small',
-          'small',
-          'medium',
-          'large',
-          'x-large',
-          'xx-large',
-          '-webkit-xxx-large',
-        ];
-        const styleAttrs = {
-          color: 'color',
-          face: 'font-family',
-          size: 'font-size',
-        };
-        if (!node.styleStr) node.styleStr = '';
-        Object.keys(styleAttrs).forEach((key) => {
-          if (node.attr[key]) {
-            const value = key === 'size' ? fontSize[node.attr[key] - 1] : node.attr[key];
-            node.styleStr += `${styleAttrs[key]}: ${value};`;
-          }
-        });
-      }
-
-      // 临时记录source资源
-      if (node.tag === 'source') {
-        results.source = node.attr.src;
-      }
-
-      if (customHandler.start) {
-        customHandler.start(node, results);
-      }
-
-      if (unary) {
-        // if this tag doesn't have end tag
-        // like <img src="hoge.png"/>
-        // add to parents
-        const parent = bufArray[0] || results;
-        if (parent.nodes === undefined) {
-          parent.nodes = [];
-        }
-        parent.nodes.push(node);
-      } else {
-        bufArray.unshift(node);
-      }
-    },
-    end(tag) {
-      // merge into parent tag
-      const node = bufArray.shift();
-      if (node.tag !== tag) {
-        console.error('invalid state: mismatch end tag');
-      }
-
-      // 当有缓存source资源时于于video补上src资源
-      if (node.tag === 'video' && results.source) {
-        node.attr.src = results.source;
-        delete results.source;
-      }
-
-      if (customHandler.end) {
-        customHandler.end(node, results);
-      }
-
-      if (bufArray.length === 0) {
-        results.nodes.push(node);
-      } else {
-        const parent = bufArray[0];
-        if (!parent.nodes) {
-          parent.nodes = [];
-        }
-        parent.nodes.push(node);
-      }
-    },
-    chars(text) {
-      if (!text.trim()) return;
-
-      const node = {
-        node: 'text',
-        text,
-      };
-
-      if (customHandler.chars) {
-        customHandler.chars(node, results);
-      }
-
-      if (bufArray.length === 0) {
-        results.nodes.push(node);
-      } else {
-        const parent = bufArray[0];
-        if (parent.nodes === undefined) {
-          parent.nodes = [];
-        }
-        parent.nodes.push(node);
-      }
-    },
-  });
-
-  return results;
-}
-
-export default html2json;

+ 0 - 156
components/u-parse/libs/htmlparser.js

@@ -1,156 +0,0 @@
-/**
- *
- * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
- *
- * author: Di (微信小程序开发工程师)
- * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
- *               垂直微信小程序开发交流社区
- *
- * github地址: https://github.com/icindy/wxParse
- *
- * for: 微信小程序富文本解析
- * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
- */
-// Regular Expressions for parsing tags and attributes
-
-const startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z0-9_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
-const endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
-const attr = /([a-zA-Z0-9_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
-
-function makeMap(str) {
-  const obj = {};
-  const items = str.split(',');
-  for (let i = 0; i < items.length; i += 1) obj[items[i]] = true;
-  return obj;
-}
-
-// Empty Elements - HTML 5
-const empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr');
-
-// Block Elements - HTML 5
-const block = makeMap('address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video');
-
-// Inline Elements - HTML 5
-const inline = makeMap('a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var');
-
-// Elements that you can, intentionally, leave open
-// (and which close themselves)
-const closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr');
-
-// Attributes that have their values filled in disabled="disabled"
-const fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected');
-
-function HTMLParser(html, handler) {
-  let index;
-  let chars;
-  let match;
-  let last = html;
-  const stack = [];
-
-  stack.last = () => stack[stack.length - 1];
-
-  function parseEndTag(tag, tagName) {
-    // If no tag name is provided, clean shop
-    let pos;
-    if (!tagName) {
-      pos = 0;
-    } else {
-      // Find the closest opened tag of the same type
-      tagName = tagName.toLowerCase();
-      for (pos = stack.length - 1; pos >= 0; pos -= 1) {
-        if (stack[pos] === tagName) break;
-      }
-    }
-    if (pos >= 0) {
-      // Close all the open elements, up the stack
-      for (let i = stack.length - 1; i >= pos; i -= 1) {
-        if (handler.end) handler.end(stack[i]);
-      }
-
-      // Remove the open elements from the stack
-      stack.length = pos;
-    }
-  }
-
-  function parseStartTag(tag, tagName, rest, unary) {
-    tagName = tagName.toLowerCase();
-
-    if (block[tagName]) {
-      while (stack.last() && inline[stack.last()]) {
-        parseEndTag('', stack.last());
-      }
-    }
-
-    if (closeSelf[tagName] && stack.last() === tagName) {
-      parseEndTag('', tagName);
-    }
-
-    unary = empty[tagName] || !!unary;
-
-    if (!unary) stack.push(tagName);
-
-    if (handler.start) {
-      const attrs = [];
-
-      rest.replace(attr, function genAttr(matches, name) {
-        const value = arguments[2] || arguments[3] || arguments[4] || (fillAttrs[name] ? name : '');
-
-        attrs.push({
-          name,
-          value,
-          escaped: value.replace(/(^|[^\\])"/g, '$1\\"'), // "
-        });
-      });
-
-      if (handler.start) {
-        handler.start(tagName, attrs, unary);
-      }
-    }
-  }
-
-  while (html) {
-    chars = true;
-
-    if (html.indexOf('</') === 0) {
-      match = html.match(endTag);
-
-      if (match) {
-        html = html.substring(match[0].length);
-        match[0].replace(endTag, parseEndTag);
-        chars = false;
-      }
-
-      // start tag
-    } else if (html.indexOf('<') === 0) {
-      match = html.match(startTag);
-
-      if (match) {
-        html = html.substring(match[0].length);
-        match[0].replace(startTag, parseStartTag);
-        chars = false;
-      }
-    }
-
-    if (chars) {
-      index = html.indexOf('<');
-      let text = '';
-      while (index === 0) {
-        text += '<';
-        html = html.substring(1);
-        index = html.indexOf('<');
-      }
-      text += index < 0 ? html : html.substring(0, index);
-      html = index < 0 ? '' : html.substring(index);
-
-      if (handler.chars) handler.chars(text);
-    }
-
-    if (html === last) throw new Error(`Parse Error: ${html}`);
-    last = html;
-  }
-
-  // Clean up any remaining tags
-  parseEndTag();
-}
-
-export default HTMLParser;

+ 0 - 195
components/u-parse/libs/wxDiscode.js

@@ -1,195 +0,0 @@
-// HTML 支持的数学符号
-function strNumDiscode(str) {
-  str = str.replace(/&forall;/g, '∀');
-  str = str.replace(/&part;/g, '∂');
-  str = str.replace(/&exist;/g, '∃');
-  str = str.replace(/&empty;/g, '∅');
-  str = str.replace(/&nabla;/g, '∇');
-  str = str.replace(/&isin;/g, '∈');
-  str = str.replace(/&notin;/g, '∉');
-  str = str.replace(/&ni;/g, '∋');
-  str = str.replace(/&prod;/g, '∏');
-  str = str.replace(/&sum;/g, '∑');
-  str = str.replace(/&minus;/g, '−');
-  str = str.replace(/&lowast;/g, '∗');
-  str = str.replace(/&radic;/g, '√');
-  str = str.replace(/&prop;/g, '∝');
-  str = str.replace(/&infin;/g, '∞');
-  str = str.replace(/&ang;/g, '∠');
-  str = str.replace(/&and;/g, '∧');
-  str = str.replace(/&or;/g, '∨');
-  str = str.replace(/&cap;/g, '∩');
-  str = str.replace(/&cup;/g, '∪');
-  str = str.replace(/&int;/g, '∫');
-  str = str.replace(/&there4;/g, '∴');
-  str = str.replace(/&sim;/g, '∼');
-  str = str.replace(/&cong;/g, '≅');
-  str = str.replace(/&asymp;/g, '≈');
-  str = str.replace(/&ne;/g, '≠');
-  str = str.replace(/&le;/g, '≤');
-  str = str.replace(/&ge;/g, '≥');
-  str = str.replace(/&sub;/g, '⊂');
-  str = str.replace(/&sup;/g, '⊃');
-  str = str.replace(/&nsub;/g, '⊄');
-  str = str.replace(/&sube;/g, '⊆');
-  str = str.replace(/&supe;/g, '⊇');
-  str = str.replace(/&oplus;/g, '⊕');
-  str = str.replace(/&otimes;/g, '⊗');
-  str = str.replace(/&perp;/g, '⊥');
-  str = str.replace(/&sdot;/g, '⋅');
-  return str;
-}
-
-// HTML 支持的希腊字母
-function strGreeceDiscode(str) {
-  str = str.replace(/&Alpha;/g, 'Α');
-  str = str.replace(/&Beta;/g, 'Β');
-  str = str.replace(/&Gamma;/g, 'Γ');
-  str = str.replace(/&Delta;/g, 'Δ');
-  str = str.replace(/&Epsilon;/g, 'Ε');
-  str = str.replace(/&Zeta;/g, 'Ζ');
-  str = str.replace(/&Eta;/g, 'Η');
-  str = str.replace(/&Theta;/g, 'Θ');
-  str = str.replace(/&Iota;/g, 'Ι');
-  str = str.replace(/&Kappa;/g, 'Κ');
-  str = str.replace(/&Lambda;/g, 'Λ');
-  str = str.replace(/&Mu;/g, 'Μ');
-  str = str.replace(/&Nu;/g, 'Ν');
-  str = str.replace(/&Xi;/g, 'Ν');
-  str = str.replace(/&Omicron;/g, 'Ο');
-  str = str.replace(/&Pi;/g, 'Π');
-  str = str.replace(/&Rho;/g, 'Ρ');
-  str = str.replace(/&Sigma;/g, 'Σ');
-  str = str.replace(/&Tau;/g, 'Τ');
-  str = str.replace(/&Upsilon;/g, 'Υ');
-  str = str.replace(/&Phi;/g, 'Φ');
-  str = str.replace(/&Chi;/g, 'Χ');
-  str = str.replace(/&Psi;/g, 'Ψ');
-  str = str.replace(/&Omega;/g, 'Ω');
-
-  str = str.replace(/&alpha;/g, 'α');
-  str = str.replace(/&beta;/g, 'β');
-  str = str.replace(/&gamma;/g, 'γ');
-  str = str.replace(/&delta;/g, 'δ');
-  str = str.replace(/&epsilon;/g, 'ε');
-  str = str.replace(/&zeta;/g, 'ζ');
-  str = str.replace(/&eta;/g, 'η');
-  str = str.replace(/&theta;/g, 'θ');
-  str = str.replace(/&iota;/g, 'ι');
-  str = str.replace(/&kappa;/g, 'κ');
-  str = str.replace(/&lambda;/g, 'λ');
-  str = str.replace(/&mu;/g, 'μ');
-  str = str.replace(/&nu;/g, 'ν');
-  str = str.replace(/&xi;/g, 'ξ');
-  str = str.replace(/&omicron;/g, 'ο');
-  str = str.replace(/&pi;/g, 'π');
-  str = str.replace(/&rho;/g, 'ρ');
-  str = str.replace(/&sigmaf;/g, 'ς');
-  str = str.replace(/&sigma;/g, 'σ');
-  str = str.replace(/&tau;/g, 'τ');
-  str = str.replace(/&upsilon;/g, 'υ');
-  str = str.replace(/&phi;/g, 'φ');
-  str = str.replace(/&chi;/g, 'χ');
-  str = str.replace(/&psi;/g, 'ψ');
-  str = str.replace(/&omega;/g, 'ω');
-  str = str.replace(/&thetasym;/g, 'ϑ');
-  str = str.replace(/&upsih;/g, 'ϒ');
-  str = str.replace(/&piv;/g, 'ϖ');
-  str = str.replace(/&middot;/g, '·');
-  return str;
-}
-
-function strcharacterDiscode(str) {
-  // 加入常用解析
-  str = str.replace(/&nbsp;/g, ' ');
-  str = str.replace(/&ensp;/g, ' ');
-  str = str.replace(/&emsp;/g, ' ');
-  str = str.replace(/&quot;/g, "'");
-  str = str.replace(/&amp;/g, '&');
-  str = str.replace(/&lt;/g, '<');
-  str = str.replace(/&gt;/g, '>');
-  str = str.replace(/&#8226;/g, '•');
-
-  return str;
-}
-
-// HTML 支持的其他实体
-function strOtherDiscode(str) {
-  str = str.replace(/&OElig;/g, 'Œ');
-  str = str.replace(/&oelig;/g, 'œ');
-  str = str.replace(/&Scaron;/g, 'Š');
-  str = str.replace(/&scaron;/g, 'š');
-  str = str.replace(/&Yuml;/g, 'Ÿ');
-  str = str.replace(/&fnof;/g, 'ƒ');
-  str = str.replace(/&circ;/g, 'ˆ');
-  str = str.replace(/&tilde;/g, '˜');
-  str = str.replace(/&ensp;/g, '');
-  str = str.replace(/&emsp;/g, '');
-  str = str.replace(/&thinsp;/g, '');
-  str = str.replace(/&zwnj;/g, '');
-  str = str.replace(/&zwj;/g, '');
-  str = str.replace(/&lrm;/g, '');
-  str = str.replace(/&rlm;/g, '');
-  str = str.replace(/&ndash;/g, '–');
-  str = str.replace(/&mdash;/g, '—');
-  str = str.replace(/&lsquo;/g, '‘');
-  str = str.replace(/&rsquo;/g, '’');
-  str = str.replace(/&sbquo;/g, '‚');
-  str = str.replace(/&ldquo;/g, '“');
-  str = str.replace(/&rdquo;/g, '”');
-  str = str.replace(/&bdquo;/g, '„');
-  str = str.replace(/&dagger;/g, '†');
-  str = str.replace(/&Dagger;/g, '‡');
-  str = str.replace(/&bull;/g, '•');
-  str = str.replace(/&hellip;/g, '…');
-  str = str.replace(/&permil;/g, '‰');
-  str = str.replace(/&prime;/g, '′');
-  str = str.replace(/&Prime;/g, '″');
-  str = str.replace(/&lsaquo;/g, '‹');
-  str = str.replace(/&rsaquo;/g, '›');
-  str = str.replace(/&oline;/g, '‾');
-  str = str.replace(/&euro;/g, '€');
-  str = str.replace(/&trade;/g, '™');
-
-  str = str.replace(/&larr;/g, '←');
-  str = str.replace(/&uarr;/g, '↑');
-  str = str.replace(/&rarr;/g, '→');
-  str = str.replace(/&darr;/g, '↓');
-  str = str.replace(/&harr;/g, '↔');
-  str = str.replace(/&crarr;/g, '↵');
-  str = str.replace(/&lceil;/g, '⌈');
-  str = str.replace(/&rceil;/g, '⌉');
-
-  str = str.replace(/&lfloor;/g, '⌊');
-  str = str.replace(/&rfloor;/g, '⌋');
-  str = str.replace(/&loz;/g, '◊');
-  str = str.replace(/&spades;/g, '♠');
-  str = str.replace(/&clubs;/g, '♣');
-  str = str.replace(/&hearts;/g, '♥');
-
-  str = str.replace(/&diams;/g, '♦');
-  str = str.replace(/&#39;/g, "'");
-  return str;
-}
-
-function strDiscode(str) {
-  str = strNumDiscode(str);
-  str = strGreeceDiscode(str);
-  str = strcharacterDiscode(str);
-  str = strOtherDiscode(str);
-  return str;
-}
-
-function urlToHttpUrl(url, domain) {
-  if (/^\/\//.test(url)) {
-    return `https:${url}`;
-  } else if (/^\//.test(url)) {
-    return `https://${domain}${url}`;
-  }
-  return url;
-}
-
-export default {
-  strDiscode,
-  urlToHttpUrl,
-};

+ 0 - 102
components/u-parse/readme.md

@@ -1,102 +0,0 @@
-## uParse 适用于 uni-app/mpvue 的富文本解析组件
-
-> 支持 Html、Markdown 解析,Fork自: [mpvue-wxParse](https://github.com/F-loat/mpvue-wxParse)
-
-
-## 属性
-
-| 名称             | 类型          | 默认值        | 描述               |
-| -----------------|--------------- | ------------- | ----------------  |
-| loading          | Boolean        | false         | 数据加载状态       |
-| className        | String         | —             | 自定义 class 名称  |
-| content          | String         | —             | 渲染内容           |
-| noData           | String         | 数据不能为空   | 空数据时的渲染展示  |
-| startHandler     | Function       | 见源码         | 自定义 parser 函数 |
-| endHandler       | Function       | null          | 自定义 parser 函数 |
-| charsHandler     | Function       | null          | 自定义 parser 函数 |
-| imageProp        | Object         | 见下文        | 图片相关参数        |
-
-### 自定义 parser 函数具体介绍
-
-* 传入的参数为当前节点 `node` 对象及解析结果 `results` 对象,例如 `startHandler(node, results)`
-* 无需返回值,通过对传入的参数直接操作来完成需要的改动
-* 自定义函数会在原解析函数处理之后执行
-
-### imageProp 对象具体属性
-
-| 名称              | 类型           | 默认值        | 描述                |
-| -----------------|--------------- | ------------- | ------------------ |
-| mode             | String         | 'aspectFit'   | 图片裁剪、缩放的模式 |
-| padding          | Number         | 0             | 图片内边距          |
-| lazyLoad         | Boolean        | false         | 图片懒加载          |
-| domain           | String         | ''            | 图片服务域名        |
-
-## 事件
-
-| 名称             | 参数              | 描述              |
-| -----------------|----------------- | ----------------  |
-| preview          | 图片地址,原始事件 | 预览图片时触发     |
-| navigate         | 链接地址,原始事件 | 点击链接时触发     |
-
-## 基本使用方法
-
-
-``` vue
-<template>
-  <div>
-    <u-parse :content="article" @preview="preview" @navigate="navigate" />
-  </div>
-</template>
-
-<script>
-import uParse from '@/components/u-parse/u-parse.vue'
-
-export default {
-  components: {
-    uParse
-  },
-  data () {
-    return {
-      article: '<div>我是HTML代码</div>'
-    }
-  },
-  methods: {
-    preview(src, e) {
-      // do something
-    },
-    navigate(href, e) {
-      // do something
-    }
-  }
-}
-</script>
-
-<style>
-@import url("@/components/u-parse/u-parse.css");
-</style>
-```
-
-
-## 渲染 Markdown
-
-> 先将 markdown 转换为 html 即可
-
-```
-npm install marked
-```
-
-``` js
-import marked from 'marked'
-import uParse from '@/components/u-parse/u-parse.vue'
-
-export default {
-  components: {
-    uParse
-  },
-  data () {
-    return {
-      article: marked(`#hello, markdown!`)
-    }
-  }
-}
-```

+ 0 - 232
components/u-parse/u-parse.css

@@ -1,232 +0,0 @@
-/**
- * author: Di (微信小程序开发工程师)
- * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
- *         垂直微信小程序开发交流社区
- *
- * github地址: https://github.com/icindy/wxParse
- *
- * for: 微信小程序富文本解析
- * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
- */
-
-.wxParse {
-  width: 100%;
-  font-family: Helvetica, sans-serif;
-  font-size: 30upx;
-  color: #666;
-  line-height: 1.8;
-}
-
-.wxParse view {
-  word-break: hyphenate;
-}
-
-.wxParse .inline {
-  display: inline;
-  margin: 0;
-  padding: 0;
-}
-
-.wxParse .div {
-  margin: 0;
-  padding: 0;
-}
-
-.wxParse .h1 .text {
-  font-size: 2em;
-  margin: 0.67em 0;
-}
-.wxParse .h2 .text {
-  font-size: 1.5em;
-  margin: 0.83em 0;
-}
-.wxParse .h3 .text {
-  font-size: 1.17em;
-  margin: 1em 0;
-}
-.wxParse .h4 .text {
-  margin: 1.33em 0;
-}
-.wxParse .h5 .text {
-  font-size: 0.83em;
-  margin: 1.67em 0;
-}
-.wxParse .h6 .text {
-  font-size: 0.67em;
-  margin: 2.33em 0;
-}
-
-.wxParse .h1 .text,
-.wxParse .h2 .text,
-.wxParse .h3 .text,
-.wxParse .h4 .text,
-.wxParse .h5 .text,
-.wxParse .h6 .text,
-.wxParse .b,
-.wxParse .strong {
-  font-weight: bolder;
-}
-
-
-.wxParse .p {
-  margin: 1em 0;
-}
-
-.wxParse .i,
-.wxParse .cite,
-.wxParse .em,
-.wxParse .var,
-.wxParse .address {
-  font-style: italic;
-}
-
-.wxParse .pre,
-.wxParse .tt,
-.wxParse .code,
-.wxParse .kbd,
-.wxParse .samp {
-  font-family: monospace;
-}
-.wxParse .pre {
-  overflow: auto;
-  background: #f5f5f5;
-  padding: 16upx;
-  white-space: pre;
-  margin: 1em 0upx;
-}
-.wxParse .code {
-  display: inline;
-  background: #f5f5f5;
-}
-
-.wxParse .big {
-  font-size: 1.17em;
-}
-
-.wxParse .small,
-.wxParse .sub,
-.wxParse .sup {
-  font-size: 0.83em;
-}
-
-.wxParse .sub {
-  vertical-align: sub;
-}
-.wxParse .sup {
-  vertical-align: super;
-}
-
-.wxParse .s,
-.wxParse .strike,
-.wxParse .del {
-  text-decoration: line-through;
-}
-
-.wxParse .strong,
-.wxParse .s {
-  display: inline;
-}
-
-.wxParse .a {
-  color: deepskyblue;
-}
-
-.wxParse .video {
-  text-align: center;
-  margin: 22upx 0;
-}
-
-.wxParse .video-video {
-  width: 100%;
-}
-
-.wxParse .img {
-  display: inline-block;
-  width: 0;
-  height: 0;
-  max-width: 100%;
-  overflow: hidden;
-}
-
-.wxParse .blockquote {
-  margin: 10upx 0;
-  padding: 22upx 0 22upx 22upx;
-  font-family: Courier, Calibri, "宋体";
-  background: #f5f5f5;
-  border-left: 6upx solid #dbdbdb;
-}
-.wxParse .blockquote .p {
-  margin: 0;
-}
-
-.wxParse .ul, .wxParse .ol {
-  display: block;
-  margin: 1em 0;
-  padding-left: 33upx;
-}
-.wxParse .ol {
-  list-style-type: disc;
-}
-.wxParse .ol {
-  list-style-type: decimal;
-}
-.wxParse .ol>weixin-parse-template,.wxParse .ul>weixin-parse-template {
-  display: list-item;
-  align-items: baseline;
-  text-align: match-parent;
-}
-
-.wxParse .ol>.li,.wxParse .ul>.li {
-  display: list-item;
-  align-items: baseline;
-  text-align: match-parent;
-}
-.wxParse .ul .ul, .wxParse .ol .ul {
-  list-style-type: circle;
-}
-.wxParse .ol .ol .ul, .wxParse .ol .ul .ul, .wxParse .ul .ol .ul, .wxParse .ul .ul .ul {
-    list-style-type: square;
-}
-
-.wxParse .u {
-  text-decoration: underline;
-}
-.wxParse .hide {
-  display: none;
-}
-.wxParse .del {
-  display: inline;
-}
-.wxParse .figure {
-  overflow: hidden;
-}
-
-.wxParse .table {
-  width: 100%;
-}
-.wxParse .thead, .wxParse .tfoot, .wxParse .tr {
-  display: flex;
-  flex-direction: row;
-}
-.wxParse .tr {
-  width:100%;
-  display: flex;
-  border-right: 2upx solid #e0e0e0;
-  border-bottom: 2upx solid #e0e0e0;
-}
-.wxParse .th,
-.wxParse .td {
-  display: flex;
-  width: 1276upx;
-  overflow: auto;
-  flex: 1;
-  padding: 11upx;
-  border-left: 2upx solid #e0e0e0;
-}
-.wxParse .td:last {
-  border-top: 2upx solid #e0e0e0;
-}
-.wxParse .th {
-  background: #f0f0f0;
-  border-top: 2upx solid #e0e0e0;
-}

+ 0 - 118
components/u-parse/u-parse.vue

@@ -1,118 +0,0 @@
-<!--**
- * forked from:https://github.com/F-loat/mpvue-wxParse
- *
- * github地址: https://github.com/dcloudio/uParse
- *
- * for: uni-app框架下 富文本解析
- */-->
-
-<template>
-<!--基础元素-->
-<div class="wxParse" :class="className" v-if="!loading">
-  <block v-for="(node,index) of nodes" :key="index">
-    <wxParseTemplate :node="node" />
-  </block>
-</div>
-</template>
-
-<script>
-import HtmlToJson from './libs/html2json';
-import wxParseTemplate from './components/wxParseTemplate0';
-
-export default {
-  name: 'wxParse',
-  props: {
-    loading: {
-      type: Boolean,
-      default: false,
-    },
-    className: {
-      type: String,
-      default: '',
-    },
-    content: {
-      type: String,
-      default: '',
-    },
-    noData: {
-      type: String,
-      default: '<div style="color: red;">数据不能为空</div>',
-    },
-    startHandler: {
-      type: Function,
-      default() {
-        return (node) => {
-          node.attr.class = null;
-          node.attr.style = null;
-        };
-      },
-    },
-    endHandler: {
-      type: Function,
-      default: null,
-    },
-    charsHandler: {
-      type: Function,
-      default: null,
-    },
-    imageProp: {
-      type: Object,
-      default() {
-        return {
-          mode: 'aspectFit',
-          padding: 0,
-          lazyLoad: false,
-          domain: '',
-        };
-      },
-    },
-  },
-  components: {
-    wxParseTemplate,
-  },
-  data() {
-    return {
-      imageUrls: [],
-    };
-  },
-  computed: {
-    nodes() {
-      const {
-        content,
-        noData,
-        imageProp,
-        startHandler,
-        endHandler,
-        charsHandler,
-      } = this;
-      const parseData = content || noData;
-      const customHandler = {
-        start: startHandler,
-        end: endHandler,
-        chars: charsHandler,
-      };
-      const results = HtmlToJson(parseData, customHandler, imageProp, this);
-      this.imageUrls = results.imageUrls;
-      console.log(results)
-      return results.nodes;
-    },
-  },
-  methods: {
-    navigate(href, $event) {
-      this.$emit('navigate', href, $event);
-    },
-    preview(src, $event) {
-      if (!this.imageUrls.length) return;
-      wx.previewImage({
-        current: src,
-        urls: this.imageUrls,
-      });
-      this.$emit('preview', src, $event);
-    },
-    removeImageUrl(src) {
-      const { imageUrls } = this;
-      imageUrls.splice(imageUrls.indexOf(src), 1);
-    },
-  },
-};
-</script>

+ 7 - 9
pages/guild/itemIndex.vue

@@ -188,15 +188,10 @@
 								<countdown :startTime="utils.date('Y-m-d H:i:s')"
 									:endTime="utils.date('Y-m-d H:i:s',item.rend_time)" />
 							</view>
-
 							<view class="fx-g1"></view>
 							<view class="sbtn-no">未预约无法入场</view>
 						</template>
 					</view>
-
-
-
-
 				</view>
 			</view>
 		</view>
@@ -210,11 +205,10 @@
 			<view class="body fx-h fx-bc fx-ac">
 				<view style="font-size: 16px;color: #333;font-weight: bold;padding-bottom: 25rpx;">CBB产品订单购买协议</view>
 				<scroll-view scroll-y class="max-he">
-					<uv-parse  :content="topData.content"></uv-parse>
+					<mp-html  :content="topData.content"></mp-html>
 				</scroll-view>
 				<view class="btn" @tap="tapAction">已阅读并同意</view>
 			</view>
-
 		</view>
 		<uv-modal ref='itemModal' title="预约场次" :showConfirmButton="false">
 			<view class="booking">
@@ -233,14 +227,13 @@
 
 <script>
 	import countdown from "@/components/cz-countdown/cz-countdown.vue";
-	import uParse from '@/components/u-parse/u-parse.vue'
 	import {
 		mapState,
 		mapMutations
 	} from 'vuex';
 	export default {
 		components: {
-			countdown,
+			countdown
 		},
 		computed: mapState(['user', 'sysData']),
 		data() {
@@ -296,6 +289,11 @@
 					.then(res => {
 						if (res.code == 200) {
 							this.topData = res.data;
+							let content = this.topData.content.replace(/&lt;/g,'<')
+							content = content.replace(/&gt;/g,'>')
+							content = content.replace(/&lt;\/p&gt;/g,'')
+							console.log(content,'content')
+							this.topData.content = content
 						}
 					});
 			},

+ 1 - 1
pages/index/index.nvue

@@ -184,7 +184,7 @@
 						{{title}}
 					</text>
 					<scroll-view scroll-y class="max-he">
-						<uv-parse :content="content"></uv-parse>
+						<mp-html lazyLoad :content="content"></mp-html>
 					</scroll-view>
 					<view class="foot">
 						<view class="btnBox">

+ 2 - 1
pages/index/index.vue

@@ -224,7 +224,7 @@
 						{{title}}
 					</view>
 					<scroll-view scroll-y class="max-he">
-					<uv-parse :content="content"></uv-parse>
+					<mp-html :content="content"></mp-html>
 					</scroll-view>
 					<view class="fx-r fx-bc fx-ac foot" style="margin-top: 60rpx;">
 						<view class="btn" @tap="tapYGdBtn">未阅读,去查看></view>
@@ -1161,6 +1161,7 @@
 	}
 
 	.max-he {
+		width: 500rpx;
 		height: 43vw;
 	}
 

+ 1 - 1
pages/news/about.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 1 - 1
pages/news/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 1 - 1
pages/operation/agreement.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 1 - 1
pages/operation/cancellation.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 1 - 1
pages/operation/package.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 1 - 1
pages/operation/user.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view id="box">
-			<uv-parse :content="content"  v-if="isShow"></uv-parse>
+			<mp-html :content="content"  v-if="isShow"></mp-html>
 		</view>
 	</view>
 </template>

+ 194 - 0
uni_modules/mp-html/README.md

@@ -0,0 +1,194 @@
+## 为减小组件包的大小,默认组件包中不包含编辑、latex 公式等扩展功能,需要使用扩展功能的请参考下方的 插件扩展 栏的说明
+
+## 功能介绍
+- 全端支持(含 `v3、NVUE`)
+- 支持丰富的标签(包括 `table`、`video`、`svg` 等)
+- 支持丰富的事件效果(自动预览图片、链接处理等)
+- 支持设置占位图(加载中、出错时、预览时)
+- 支持锚点跳转、长按复制等丰富功能
+- 支持大部分 *html* 实体
+- 丰富的插件(关键词搜索、内容编辑、`latex` 公式等)
+- 效率高、容错性强且轻量化
+
+查看 [功能介绍](https://jin-yufeng.gitee.io/mp-html/#/overview/feature) 了解更多
+
+## 使用方法
+- `uni_modules` 方式  
+  1. 点击右上角的 `使用 HBuilder X 导入插件` 按钮直接导入项目或点击 `下载插件 ZIP` 按钮下载插件包并解压到项目的 `uni_modules/mp-html` 目录下  
+  2. 在需要使用页面的 `(n)vue` 文件中添加  
+     ```html
+     <!-- 不需要引入,可直接使用 -->
+     <mp-html :content="html" />
+     ```
+     ```javascript
+     export default {
+       data() {
+         return {
+           html: '<div>Hello World!</div>'
+         }
+       }
+     }
+     ```
+  3. 需要更新版本时在 `HBuilder X` 中右键 `uni_modules/mp-html` 目录选择 `从插件市场更新` 即可  
+
+- 源码方式  
+  1. 从 [github](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 或 [gitee](https://gitee.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 下载源码  
+     插件市场的 **非 uni_modules 版本** 无法更新,不建议从插件市场获取  
+  2. 在需要使用页面的 `(n)vue` 文件中添加  
+     ```html
+     <mp-html :content="html" />
+     ```
+     ```javascript
+     import mpHtml from '@/components/mp-html/mp-html'
+     export default {
+       // HBuilderX 2.5.5+ 可以通过 easycom 自动引入
+       components: {
+         mpHtml
+       },
+       data() {
+         return {
+           html: '<div>Hello World!</div>'
+         }
+       }
+     }
+     ```
+
+- npm 方式  
+  1. 在项目根目录下执行  
+     ```bash
+     npm install mp-html
+     ```
+  2. 在需要使用页面的 `(n)vue` 文件中添加  
+     ```html
+     <mp-html :content="html" />
+     ```
+     ```javascript
+     import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
+     export default {
+       // 不可省略
+       components: {
+         mpHtml
+       },
+       data() {
+         return {
+           html: '<div>Hello World!</div>'
+         }
+       }
+     }
+     ```
+  3. 需要更新版本时执行以下命令即可  
+     ```bash
+     npm update mp-html
+     ```
+  
+  使用 *cli* 方式运行的项目,通过 *npm* 方式引入时,需要在 *vue.config.js* 中配置 *transpileDependencies*,详情可见 [#330](https://github.com/jin-yufeng/mp-html/issues/330#issuecomment-913617687)  
+  如果在 **nvue** 中使用还要将 `dist/uni-app/static` 目录下的内容拷贝到项目的 `static` 目录下,否则无法运行  
+
+查看 [快速开始](https://jin-yufeng.gitee.io/mp-html/#/overview/quickstart) 了解更多
+
+## 组件属性
+
+| 属性 | 类型 | 默认值 | 说明 |
+|:---:|:---:|:---:|---|
+| container-style | String |  | 容器的样式([2.1.0+](https://jin-yufeng.gitee.io/mp-html/#/changelog/changelog#v210)) |
+| content | String |  | 用于渲染的 html 字符串 |
+| copy-link | Boolean | true | 是否允许外部链接被点击时自动复制 |
+| domain | String |  | 主域名(用于链接拼接) |
+| error-img | String |  | 图片出错时的占位图链接 |
+| lazy-load | Boolean | false | 是否开启图片懒加载 |
+| loading-img | String |  | 图片加载过程中的占位图链接 |
+| pause-video | Boolean | true | 是否在播放一个视频时自动暂停其他视频 |
+| preview-img | Boolean | true | 是否允许图片被点击时自动预览 |
+| scroll-table | Boolean | false | 是否给每个表格添加一个滚动层使其能单独横向滚动 |
+| selectable | Boolean | false | 是否开启文本长按复制 |
+| set-title | Boolean | true | 是否将 title 标签的内容设置到页面标题 |
+| show-img-menu | Boolean | true | 是否允许图片被长按时显示菜单 |
+| tag-style | Object |  | 设置标签的默认样式 |
+| use-anchor | Boolean | false | 是否使用锚点链接 |
+
+查看 [属性](https://jin-yufeng.gitee.io/mp-html/#/basic/prop) 了解更多
+
+## 组件事件
+
+| 名称 | 触发时机 |
+|:---:|---|
+| load | dom 树加载完毕时 |
+| ready | 图片加载完毕时 |
+| error | 发生渲染错误时 |
+| imgtap | 图片被点击时 |
+| linktap | 链接被点击时 |
+| play | 音视频播放时 |
+
+查看 [事件](https://jin-yufeng.gitee.io/mp-html/#/basic/event) 了解更多
+
+## api
+组件实例上提供了一些 `api` 方法可供调用
+
+| 名称 | 作用 |
+|:---:|---|
+| in | 将锚点跳转的范围限定在一个 scroll-view 内 |
+| navigateTo | 锚点跳转 |
+| getText | 获取文本内容 |
+| getRect | 获取富文本内容的位置和大小 |
+| setContent | 设置富文本内容 |
+| imgList | 获取所有图片的数组 |
+| pauseMedia | 暂停播放音视频([2.2.2+](https://jin-yufeng.gitee.io/mp-html/#/changelog/changelog#v222)) |
+| setPlaybackRate | 设置音视频播放速率([2.4.0+](https://jin-yufeng.gitee.io/mp-html/#/changelog/changelog#v240)) |
+
+查看 [api](https://jin-yufeng.gitee.io/mp-html/#/advanced/api) 了解更多
+
+## 插件扩展  
+除基本功能外,本组件还提供了丰富的扩展,可按照需要选用
+
+| 名称 | 作用 |
+|:---:|---|
+| audio | 音乐播放器 |
+| editable | 富文本 **编辑**([示例项目](https://mp-html.oss-cn-hangzhou.aliyuncs.com/editable.zip)) |
+| emoji | 解析 emoji |
+| highlight | 代码块高亮显示 |
+| markdown | 渲染 markdown |
+| search | 关键词搜索 |
+| style | 匹配 style 标签中的样式 |
+| txv-video | 使用腾讯视频 |
+| img-cache | 图片缓存 by [@PentaTea](https://github.com/PentaTea) |
+| latex | 渲染 latex 公式 by [@Zeng-J](https://github.com/Zeng-J) |
+
+从插件市场导入的包中 **不含有** 扩展插件,使用插件需通过微信小程序 `富文本插件` 获取或参考以下方法进行打包:  
+1. 获取完整组件包  
+   ```bash
+   npm install mp-html
+   ```
+2. 编辑 `tools/config.js` 中的 `plugins` 项,选择需要的插件  
+3. 生成新的组件包  
+   在 `node_modules/mp-html` 目录下执行  
+   ```bash
+   npm install
+   npm run build:uni-app
+   ```
+4. 拷贝 `dist/uni-app` 中的内容到项目根目录  
+
+查看 [插件](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin) 了解更多
+
+## 关于 nvue
+`nvue` 使用原生渲染,不支持部分 `css` 样式,为实现和 `html` 相同的效果,组件内部通过 `web-view` 进行渲染,性能上差于原生,根据 `weex` 官方建议,`web` 标签仅应用在非常规的降级场景。因此,如果通过原生的方式(如 `richtext`)能够满足需要,则不建议使用本组件,如果有较多的富文本内容,则可以直接使用 `vue` 页面  
+由于渲染方式与其他端不同,有以下限制:  
+1. 不支持 `lazy-load` 属性
+2. 视频不支持全屏播放
+3. 如果在 `flex-direction: row` 的容器中使用,需要给组件设置宽度或设置 `flex: 1` 占满剩余宽度
+
+纯 `nvue` 模式下,[此问题](https://ask.dcloud.net.cn/question/119678) 修复前,不支持通过 `uni_modules` 引入,需要本地引入(将 [dist/uni-app](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 中的内容拷贝到项目根目录下)  
+
+## 立即体验
+![富文本插件](https://mp-html.oss-cn-hangzhou.aliyuncs.com/qrcode.jpg)
+
+## 问题反馈
+遇到问题时,请先查阅 [常见问题](https://jin-yufeng.gitee.io/mp-html/#/question/faq) 和 [issue](https://github.com/jin-yufeng/mp-html/issues) 中是否已有相同的问题  
+可通过 [issue](https://github.com/jin-yufeng/mp-html/issues/new/choose) 、插件问答或发送邮件到 [mp_html@126.com](mailto:mp_html@126.com) 提问,不建议在评论区提问(不方便回复)  
+提问请严格按照 [issue 模板](https://github.com/jin-yufeng/mp-html/issues/new/choose) ,描述清楚使用环境、`html` 内容或可复现的 `demo` 项目以及复现方式,对于 **描述不清**、**无法复现** 或重复的问题将不予回复  
+
+欢迎加入 `QQ` 交流群:  
+群1(已满):`699734691`  
+群2(已满):`778239129`  
+群3:`960265313`  
+
+查看 [问题反馈](https://jin-yufeng.gitee.io/mp-html/#/question/feedback) 了解更多

+ 150 - 0
uni_modules/mp-html/changelog.md

@@ -0,0 +1,150 @@
+## v2.5.0(2024-04-22)
+1. `U` `play` 事件增加返回 `src` 等信息 [详细](https://github.com/jin-yufeng/mp-html/issues/526)
+2. `U` `preview-img` 属性支持设置为 `all` 开启 `base64` 图片预览 [详细](https://github.com/jin-yufeng/mp-html/issues/536)
+3. `U` `editable` 插件增加简易模式(点击文字直接编辑)
+4. `U` `latex` 插件支持块级公式 [详细](https://github.com/jin-yufeng/mp-html/issues/582)
+5. `F` 修复了表格部分情况下背景丢失的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/587)
+6. `F` 修复了部分 `svg` 无法显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/591)
+7. `F` 修复了 `h5` 和 `app` 端部分情况下样式无法识别的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/518)
+8. `F` 修复了 `latex` 插件部分情况下显示不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/580)
+9. `F` 修复了 `editable` 插件表格无法删除的问题
+10. `F` 修复了 `editable` 插件 `vue3` `h5` 端点击图片报错的问题
+11. `F` 修复了 `editable` 插件点击表格没有菜单栏的问题
+## v2.4.3(2024-01-21)
+1. `A` 增加 [card](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#card) 插件 [详细](https://github.com/jin-yufeng/mp-html/pull/533) by [@whoooami](https://github.com/whoooami)
+2. `F` 修复了 `svg` 中包含 `foreignobject` 可能不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/523)
+3. `F` 修复了合并单元格的表格部分情况下显示不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/561)
+4. `F` 修复了 `img` 标签设置 `object-fit` 无效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/567)
+5. `F` 修复了 `latex` 插件公式会换行的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/540) 
+6. `F` 修复了 `editable` 和 `audio` 插件共用时点击 `audio` 无法编辑的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/529) by [@whoooami](https://github.com/whoooami)
+7. `F` 修复了微信小程序部分情况下图片会报错 `replace of undefined` 的问题
+8. `F` 修复了快手小程序图片不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/571)
+## v2.4.2(2023-05-14)
+1. `A` `editable` 插件支持修改文字颜色 [详细](https://github.com/jin-yufeng/mp-html/issues/254)
+2. `F` 修复了 `svg` 中有 `style` 不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/505)
+3. `F` 修复了使用旧版编译器可能报错 `Bad attr nodes` 的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/472)
+4. `F` 修复了 `app` 端可能出现无法读取 `lazyLoad` 的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/513)
+5. `F` 修复了 `editable` 插件在点击换图时未拼接 `domain` 的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/497) by [@TwoKe945](https://github.com/TwoKe945)
+6. `F` 修复了 `latex` 插件部分情况下不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/515) 
+7. `F` 修复了 `editable` 插件点击音视频时其他标签框不消失的问题
+## v2.4.1(2022-12-25)
+1. `F` 修复了没有图片时 `ready` 事件可能不触发的问题
+2. `F` 修复了加载过程中可能出现 `Root label not found` 错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/470)
+3. `F` 修复了 `audio` 插件退出页面可能会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/457)
+4. `F` 修复了 `vue3` 运行到 `app` 在 `HBuilder X 3.6.10` 以上报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/480)
+5. `F` 修复了 `nvue` 端链接中包含 `%22` 时可能无法显示的问题
+6. `F` 修复了 `vue3` 使用 `highlight` 插件可能报错的问题
+## v2.4.0(2022-08-27)
+1. `A` 增加了 [setPlaybackRate](https://jin-yufeng.gitee.io/mp-html/#/advanced/api#setPlaybackRate) 的 `api`,可以设置音视频的播放速率 [详细](https://github.com/jin-yufeng/mp-html/issues/452)
+2. `A` 示例小程序代码开源 [详细](https://github.com/jin-yufeng/mp-html-demo)
+3. `U` 优化 `ready` 事件触发时机,未设置懒加载的情况下基本可以准确触发 [详细](https://github.com/jin-yufeng/mp-html/issues/195)
+4. `U` `highlight` 插件在编辑状态下不进行高亮处理,便于编辑
+5. `F` 修复了 `flex` 布局下图片大小可能不正确的问题
+6. `F` 修复了 `selectable` 属性没有设置 `force` 也可能出现渲染异常的问题
+7. `F` 修复了表格中的图片大小可能不正确的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/448)
+8. `F` 修复了含有合并单元格的表格可能无法设置竖直对齐的问题
+9. `F` 修复了 `editable` 插件在 `scroll-view` 中使用时工具条位置可能不正确的问题
+10. `F` 修复了 `vue3` 使用 [search](advanced/plugin#search) 插件可能导致错误换行的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/449)
+## v2.3.2(2022-08-13)
+1. `A` 增加 [latex](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#latex) 插件,可以渲染数学公式 [详细](https://github.com/jin-yufeng/mp-html/pull/447) by [@Zeng-J](https://github.com/Zeng-J)
+2. `U` 优化根节点下有很多标签的长内容渲染速度
+3. `U` `highlight` 插件适配 `lang-xxx` 格式
+4. `F` 修复了 `table` 标签设置 `border` 属性后可能无法修改边框样式的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/439) by [@zouxingjie](https://github.com/zouxingjie)
+5. `F` 修复了 `editable` 插件输入连续空格无效的问题
+6. `F` 修复了 `vue3` 图片设置 `inline` 会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/438)
+7. `F` 修复了 `vue3` 使用 `table` 可能报错的问题
+## v2.3.1(2022-05-20)
+1. `U` `app` 端支持使用本地图片
+2. `U` 优化了微信小程序 `selectable` 属性在 `ios` 端的处理 [详细](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#selectable)
+3. `F` 修复了 `editable` 插件不在顶部时 `tooltip` 位置可能错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/430)
+4. `F` 修复了 `vue3` 运行到微信小程序可能报错丢失内容的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/414)
+5. `F` 修复了 `vue3` 部分标签可能被错误换行的问题
+6. `F` 修复了 `editable` 插件 `app` 端插入视频无法预览的问题
+## v2.3.0(2022-04-01)
+1. `A` 增加了 `play` 事件,音视频播放时触发,可用于与页面其他音视频进行互斥播放 [详细](basic/event#play)
+2. `U` `show-img-menu` 属性支持控制预览时是否长按弹出菜单
+3. `U` 优化 `wxs` 处理,提高渲染性能 [详细](https://developers.weixin.qq.com/community/develop/article/doc/0006cc2b204740f601bd43fa25a413)  
+4. `U` `video` 标签支持 `object-fit` 属性
+5. `U` 增加支持一些常用实体编码 [详细](https://github.com/jin-yufeng/mp-html/issues/418)
+6. `F` 修复了图片仅设置高度可能不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/410)
+7. `F` 修复了 `video` 标签高度设置为 `auto` 不显示的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/411)
+8. `F` 修复了使用 `grid` 布局时可能样式错误的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/413)
+9. `F` 修复了含有合并单元格的表格部分情况下显示异常的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/417)
+10. `F` 修复了 `editable` 插件连续插入内容时顺序不正确的问题
+11. `F` 修复了 `uni-app` 包 `vue3` 使用 `audio` 插件报错的问题
+12. `F` 修复了 `uni-app` 包 `highlight` 插件使用自定义的 `prism.min.js` 报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/416)
+## v2.2.2(2022-02-26)
+1. `A` 增加了 [pauseMedia](https://jin-yufeng.gitee.io/mp-html/#/advanced/api#pauseMedia) 的 `api`,可用于暂停播放音视频 [详细](https://github.com/jin-yufeng/mp-html/issues/317)
+2. `U` 优化了长内容的加载速度  
+3. `U` 适配 `vue3` [#389](https://github.com/jin-yufeng/mp-html/issues/389)、[#398](https://github.com/jin-yufeng/mp-html/pull/398) by [@zhouhuafei](https://github.com/zhouhuafei)、[#400](https://github.com/jin-yufeng/mp-html/issues/400)
+4. `F` 修复了小程序端图片高度设置为百分比时可能不显示的问题
+5. `F` 修复了 `highlight` 插件部分情况下可能显示不完整的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/403)
+## v2.2.1(2021-12-24)
+1. `A` `editable` 插件增加上下移动标签功能
+2. `U` `editable` 插件支持在文本中间光标处插入内容
+3. `F` 修复了 `nvue` 端设置 `margin` 后可能导致高度不正确的问题
+4. `F` 修复了 `highlight` 插件使用压缩版的 `prism.css` 可能导致背景失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/367)
+5. `F` 修复了编辑状态下使用 `emoji` 插件内容为空时可能报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/371)
+6. `F` 修复了使用 `editable` 插件后将 `selectable` 属性设置为 `force` 不生效的问题
+## v2.2.0(2021-10-12)
+1. `A` 增加 `customElements` 配置项,便于添加自定义功能性标签 [详细](https://github.com/jin-yufeng/mp-html/issues/350)
+2. `A` `editable` 插件增加切换音视频自动播放状态的功能 [详细](https://github.com/jin-yufeng/mp-html/pull/341) by [@leeseett](https://github.com/leeseett)
+3. `A` `editable` 插件删除媒体标签时触发 `remove` 事件,便于删除已上传的文件
+4. `U` `editable` 插件 `insertImg` 方法支持同时插入多张图片 [详细](https://github.com/jin-yufeng/mp-html/issues/342)
+5. `U` `editable` 插入图片和音视频时支持拼接 `domian` 主域名
+6. `F` 修复了内部链接参数中包含 `://` 时被认为是外部链接的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/356)
+7. `F` 修复了部分 `svg` 标签名或属性名大小写不正确时不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/351)
+8. `F` 修复了 `nvue` 页面运行到非 `app` 平台时可能样式错误的问题
+## v2.1.5(2021-08-13)
+1. `A` 增加支持标签的 `dir` 属性
+2. `F` 修复了 `ruby` 标签文字与拼音没有居中对齐的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/325)
+3. `F` 修复了音视频标签内有 `a` 标签时可能无法播放的问题
+4. `F` 修复了 `externStyle` 中的 `class` 名包含下划线或数字时可能失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/326)
+5. `F` 修复了 `h5` 端引入 `externStyle` 可能不生效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/326)
+## v2.1.4(2021-07-14)
+1. `F` 修复了 `rt` 标签无法设置样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/318)
+2. `F` 修复了表格中有单元格同时合并行和列时可能显示不正确的问题
+3. `F` 修复了 `app` 端无法关闭图片长按菜单的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/322)
+4. `F` 修复了 `editable` 插件只能添加图片链接不能修改的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/312) by [@leeseett](https://github.com/leeseett)
+## v2.1.3(2021-06-12)
+1. `A` `editable` 插件增加 `insertTable` 方法
+2. `U` `editable` 插件支持编辑表格中的空白单元格 [详细](https://github.com/jin-yufeng/mp-html/issues/310)
+3. `F` 修复了 `externStyle` 中使用伪类可能失效的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/298)
+4. `F` 修复了多个组件同时使用时 `tag-style` 属性时可能互相影响的问题 [详细](https://github.com/jin-yufeng/mp-html/pull/305) by [@woodguoyu](https://github.com/woodguoyu)
+5. `F` 修复了包含 `linearGradient` 的 `svg` 可能无法显示的问题
+6. `F` 修复了编译到头条小程序时可能报错的问题
+7. `F` 修复了 `nvue` 端不触发 `click` 事件的问题
+8. `F` 修复了 `editable` 插件尾部插入时无法撤销的问题
+9. `F` 修复了 `editable` 插件的 `insertHtml` 方法只能在末尾插入的问题
+10. `F` 修复了 `editable` 插件插入音频不显示的问题
+## v2.1.2(2021-04-24)
+1. `A` 增加了 [img-cache](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#img-cache) 插件,可以在 `app` 端缓存图片 [详细](https://github.com/jin-yufeng/mp-html/issues/292) by [@PentaTea](https://github.com/PentaTea)
+2. `U` 支持通过 `container-style` 属性设置 `white-space` 来保留连续空格和换行符 [详细](https://jin-yufeng.gitee.io/mp-html/#/question/faq#space)
+3. `U` 代码风格符合 [standard](https://standardjs.com) 标准
+4. `U` `editable` 插件编辑状态下支持预览视频 [详细](https://github.com/jin-yufeng/mp-html/issues/286)
+5. `F` 修复了 `svg` 标签内嵌 `svg` 时无法显示的问题
+6. `F` 修复了编译到支付宝和头条小程序时部分区域不可复制的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/291)
+## v2.1.1(2021-04-09)
+1. 修复了对 `p` 标签设置 `tag-style` 可能不生效的问题
+2. 修复了 `svg` 标签中的文本无法显示的问题
+3. 修复了使用 `editable` 插件编辑表格时可能报错的问题
+4. 修复了使用 `highlight` 插件运行到头条小程序时可能没有样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/280)
+5. 修复了使用 `editable` 插件 `editable` 属性为 `false` 时会报错的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/284)
+6. 修复了 `style` 插件连续子选择器失效的问题
+7. 修复了 `editable` 插件无法修改图片和字体大小的问题
+## v2.1.0.2(2021-03-21)
+修复了 `nvue` 端使用可能报错的问题
+## v2.1.0(2021-03-20)
+1. `A` 增加了 [container-style](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#container-style) 属性 [详细](https://gitee.com/jin-yufeng/mp-html/pulls/1)
+2. `A` 增加支持 `strike` 标签
+3. `A` `editable` 插件增加 `placeholder` 属性 [详细](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#editable)
+4. `A` `editable` 插件增加 `insertHtml` 方法 [详细](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#editable)
+5. `U` 外部样式支持标签名选择器 [详细](https://jin-yufeng.gitee.io/mp-html/#/overview/quickstart#setting)
+6. `F` 修复了 `nvue` 端部分情况下可能不显示的问题
+## v2.0.5(2021-03-12)
+1. `U` [linktap](https://jin-yufeng.gitee.io/mp-html/#/basic/event#linktap) 事件增加返回内部文本内容 `innerText` [详细](https://github.com/jin-yufeng/mp-html/issues/271)
+2. `U` [selectable](https://jin-yufeng.gitee.io/mp-html/#/basic/prop#selectable) 属性设置为 `force` 时能够在微信 `iOS` 端生效(文本块会变成 `inline-block`) [详细](https://github.com/jin-yufeng/mp-html/issues/267)
+3. `F` 修复了部分情况下竖向无法滚动的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/182)
+4. `F` 修复了多次修改富文本数据时部分内容可能不显示的问题
+5. `F` 修复了 [腾讯视频](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#txv-video) 插件可能无法播放的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/265)
+6. `F` 修复了 [highlight](https://jin-yufeng.gitee.io/mp-html/#/advanced/plugin#highlight) 插件没有设置高亮语言时没有应用默认样式的问题 [详细](https://github.com/jin-yufeng/mp-html/issues/276) by [@fuzui](https://github.com/fuzui)

+ 4 - 5
uni_modules/uv-parse/components/uv-parse/uv-parse.vue → uni_modules/mp-html/components/mp-html/mp-html.vue

@@ -5,16 +5,16 @@
     <node v-else :childs="nodes" :opts="[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]" name="span" />
     <!-- #endif -->
     <!-- #ifdef APP-PLUS-NVUE -->
-    <web-view ref="web" src="/uni_modules/uv-parse/static/app-plus/uv-parse/local.html" :style="'margin-top:-2px;height:' + height + 'px'" @onPostMessage="_onMessage" />
+    <web-view ref="web" src="/uni_modules/mp-html/static/app-plus/mp-html/local.html" :style="'margin-top:-2px;height:' + height + 'px'" @onPostMessage="_onMessage" />
     <!-- #endif -->
   </view>
 </template>
 
 <script>
 /**
- * uv-parse v1.0.3
+ * mp-html v2.5.0
  * @description 富文本组件
- * @tutorial https://www.uvui.cn/components/parse.html
+ * @tutorial https://github.com/jin-yufeng/mp-html
  * @property {String} container-style 容器的样式
  * @property {String} content 用于渲染的 html 字符串
  * @property {Boolean} copy-link 是否允许外部链接被点击时自动复制
@@ -46,7 +46,7 @@ const plugins=[]
 const dom = weex.requireModule('dom')
 // #endif
 export default {
-  name: 'uv-parse',
+  name: 'mp-html',
   data () {
     return {
       nodes: [],
@@ -112,7 +112,6 @@ export default {
   // #endif
   watch: {
     content (content) {
-		console.log(content,'content')
       this.setContent(content)
     }
   },

+ 17 - 7
uni_modules/uv-parse/components/uv-parse/node/node.vue → uni_modules/mp-html/components/mp-html/node/node.vue

@@ -10,13 +10,16 @@
       <!-- #endif -->
       <!-- #ifndef H5 || (APP-PLUS && VUE2) -->
       <!-- 表格中的图片,使用 rich-text 防止大小不正确 -->
-      <rich-text v-if="n.name==='img'&&n.t" :style="'display:'+n.t" :nodes="[{attrs:{style:n.attrs.style,src:n.attrs.src},name:'img'}]" :data-i="i" @tap.stop="imgTap" />
+      <rich-text v-if="n.name==='img'&&n.t" :style="'display:'+n.t" :nodes="[{attrs:{style:n.attrs.style||'',src:n.attrs.src},name:'img'}]" :data-i="i" @tap.stop="imgTap" />
       <!-- #endif -->
-      <!-- #ifndef H5 || APP-PLUS -->
-      <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:1px;'+n.attrs.style" :src="n.attrs.src" :mode="!n.h?'widthFix':(!n.w?'heightFix':'')" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="opts[3]&&!n.attrs.ignore" :image-menu-prevent="!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
+      <!-- #ifndef H5 || APP-PLUS || MP-KUAISHOU -->
+      <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:1px;'+n.attrs.style" :src="n.attrs.src" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="opts[3]&&!n.attrs.ignore" :image-menu-prevent="!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
+      <!-- #endif -->
+      <!-- #ifdef MP-KUAISHOU -->
+      <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src" :lazy-load="opts[0]" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap"></image>
       <!-- #endif -->
       <!-- #ifdef APP-PLUS && VUE3 -->
-      <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':'')" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
+      <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||''))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
       <!-- #endif -->
       <!-- 文本 -->
       <!-- #ifdef MP-WEIXIN -->
@@ -26,7 +29,6 @@
       <text v-else-if="n.text" decode>{{n.text}}</text>
       <!-- #endif -->
       <text v-else-if="n.name==='br'">\n</text>
-		<text v-else-if="n.name==='p'"></text>
       <!-- 链接 -->
       <view v-else-if="n.name==='a'" :id="n.attrs.id" :class="(n.attrs.href?'_a ':'')+n.attrs.class" hover-class="_hover" :style="'display:inline;'+n.attrs.style" :data-i="i" @tap.stop="linkTap">
         <node name="span" :childs="n.children" :opts="opts" style="display:inherit" />
@@ -146,7 +148,7 @@ export default {
   },
   mounted () {
     this.$nextTick(() => {
-      for (this.root = this.$parent; this.root.$options.name !== 'uv-parse'; this.root = this.root.$parent);
+      for (this.root = this.$parent; this.root.$options.name !== 'mp-html'; this.root = this.root.$parent);
     })
     // #ifdef H5 || APP-PLUS
     if (this.opts[0]) {
@@ -185,7 +187,15 @@ export default {
      * @param {Event} e
      */
     play (e) {
-      this.root.$emit('play')
+      const i = e.currentTarget.dataset.i
+      const node = this.childs[i]
+      this.root.$emit('play', {
+        source: node.name,
+        attrs: {
+          ...node.attrs,
+          src: node.src[this.ctrl[i] || 0]
+        }
+      })
       // #ifndef APP-PLUS
       if (this.root.pauseVideo) {
         let flag = false

+ 63 - 5
uni_modules/uv-parse/components/uv-parse/parser.js → uni_modules/mp-html/components/mp-html/parser.js

@@ -71,7 +71,8 @@ const config = {
     viewbox: 'viewBox',
     attributename: 'attributeName',
     repeatcount: 'repeatCount',
-    repeatdur: 'repeatDur'
+    repeatdur: 'repeatDur',
+    foreignobject: 'foreignObject'
   }
 }
 const tagSelector={}
@@ -332,6 +333,12 @@ Parser.prototype.onTagName = function (name) {
  */
 Parser.prototype.onAttrName = function (name) {
   name = this.xml ? name : name.toLowerCase()
+  // #ifdef (VUE3 && (H5 || APP-PLUS)) || APP-PLUS-NVUE
+  if (name.includes('?') || name.includes(';')) {
+    this.attrName = undefined
+    return
+  }
+  // #endif
   if (name.substr(0, 5) === 'data-') {
     if (name === 'data-src' && !this.attrs.src) {
       // data-src 自动转为 src
@@ -458,7 +465,7 @@ Parser.prototype.onOpenTag = function (selfClose) {
           node.webp = 'T'
         }
         // data url 图片如果没有设置 original-src 默认为不可预览的小图片
-        if (attrs.src.includes('data:') && !attrs['original-src']) {
+        if (attrs.src.includes('data:') && this.options.previewImg !== 'all' && !attrs['original-src']) {
           attrs.ignore = 'T'
         }
         if (!attrs.ignore || node.webp || attrs.src.includes('cloud://')) {
@@ -552,6 +559,13 @@ Parser.prototype.onOpenTag = function (selfClose) {
       if (!isNaN(parseInt(styleObj.height)) && (!styleObj.height.includes('%') || (parent && (parent.attrs.style || '').includes('height')))) {
         node.h = 'T'
       }
+      if (node.w && node.h && styleObj['object-fit']) {
+        if (styleObj['object-fit'] === 'contain') {
+          node.m = 'aspectFit'
+        } else if (styleObj['object-fit'] === 'cover') {
+          node.m = 'aspectFill'
+        }
+      }
     } else if (node.name === 'svg') {
       siblings.push(node)
       this.stack.push(node)
@@ -678,11 +692,19 @@ Parser.prototype.popNode = function () {
         return
       }
       const name = config.svgDict[node.name] || node.name
+      if (name === 'foreignObject') {
+        for (const child of (node.children || [])) {
+          if (child.attrs && !child.attrs.xmlns) {
+            child.attrs.xmlns = 'http://www.w3.org/1999/xhtml'
+            break
+          }
+        }
+      }
       src += '<' + name
       for (const item in node.attrs) {
         const val = node.attrs[item]
         if (val) {
-          src += ` ${config.svgDict[item] || item}="${val}"`
+          src += ` ${config.svgDict[item] || item}="${val.replace(/"/g, '')}"`
         }
       }
       if (!node.children) {
@@ -841,6 +863,10 @@ Parser.prototype.popNode = function () {
     if (node.flag && node.c) {
       // 有 colspan 或 rowspan 且含有链接的表格通过 grid 布局实现
       styleObj.display = 'grid'
+      if (styleObj['border-collapse'] === 'collapse') {
+        styleObj['border-collapse'] = undefined
+        spacing = 0
+      }
       if (spacing) {
         styleObj['grid-gap'] = spacing + 'px'
         styleObj.padding = spacing + 'px'
@@ -858,6 +884,23 @@ Parser.prototype.popNode = function () {
         for (let i = 0; i < nodes.length; i++) {
           if (nodes[i].name === 'tr') {
             trList.push(nodes[i])
+          } else if (nodes[i].name === 'colgroup') {
+            let colI = 1
+            for (const col of (nodes[i].children || [])) {
+              if (col.name === 'col') {
+                const style = col.attrs.style || ''
+                const start = style.indexOf('width') ? style.indexOf(';width') : 0
+                // 提取出宽度
+                if (start !== -1) {
+                  let end = style.indexOf(';', start + 6)
+                  if (end === -1) {
+                    end = style.length
+                  }
+                  width[colI] = style.substring(start ? start + 7 : 6, end)
+                }
+                colI += 1
+              }
+            }
           } else {
             traversal(nodes[i].children || [])
           }
@@ -984,11 +1027,26 @@ Parser.prototype.popNode = function () {
       node.children = [table]
       attrs = table.attrs
     }
+  } else if ((node.name === 'tbody' || node.name === 'tr') && node.flag && node.c) {
+    node.flag = undefined;
+    (function traversal (nodes) {
+      for (let i = 0; i < nodes.length; i++) {
+        if (nodes[i].name === 'td') {
+          // 颜色样式设置给单元格避免丢失
+          for (const style of ['color', 'background', 'background-color']) {
+            if (styleObj[style]) {
+              nodes[i].attrs.style = style + ':' + styleObj[style] + ';' + (nodes[i].attrs.style || '')
+            }
+          }
+        } else {
+          traversal(nodes[i].children || [])
+        }
+      }
+    })(children)
   } else if ((node.name === 'td' || node.name === 'th') && (attrs.colspan || attrs.rowspan)) {
     for (let i = this.stack.length; i--;) {
-      if (this.stack[i].name === 'table') {
+      if (this.stack[i].name === 'table' || this.stack[i].name === 'tbody' || this.stack[i].name === 'tr') {
         this.stack[i].flag = 1 // 指示含有合并单元格
-        break
       }
     }
   } else if (node.name === 'ruby') {

+ 76 - 0
uni_modules/mp-html/package.json

@@ -0,0 +1,76 @@
+{
+    "id": "mp-html",
+    "displayName": "mp-html 富文本组件【全端支持,支持编辑、latex等扩展】",
+    "version": "v2.5.0",
+    "description": "一个强大的富文本组件,高效轻量,功能丰富",
+    "keywords": [
+        "富文本",
+        "编辑器",
+        "html",
+        "rich-text",
+        "editor"
+    ],
+    "repository": "https://github.com/jin-yufeng/mp-html",
+    "dcloudext": {
+        "sale": {
+            "regular": {
+                "price": "0.00"
+            },
+            "sourcecode": {
+                "price": "0.00"
+            }
+        },
+        "contact": {
+            "qq": ""
+        },
+        "declaration": {
+            "ads": "无",
+            "data": "无",
+            "permissions": "无"
+        },
+        "npmurl": "https://www.npmjs.com/package/mp-html",
+        "type": "component-vue"
+    },
+    "uni_modules": {
+        "platforms": {
+            "cloud": {
+                "tcb": "y",
+                "aliyun": "y"
+            },
+            "client": {
+                "App": {
+                    "app-vue": "y",
+                    "app-nvue": "y"
+                },
+                "H5-mobile": {
+                    "Safari": "y",
+                    "Android Browser": "y",
+                    "微信浏览器(Android)": "y",
+                    "QQ浏览器(Android)": "y"
+                },
+                "H5-pc": {
+                    "Chrome": "y",
+                    "IE": "u",
+                    "Edge": "y",
+                    "Firefox": "y",
+                    "Safari": "y"
+                },
+                "小程序": {
+                    "微信": "y",
+                    "阿里": "y",
+                    "百度": "y",
+                    "字节跳动": "y",
+                    "QQ": "y"
+                },
+                "快应用": {
+                    "华为": "y",
+                    "联盟": "y"
+                },
+                "Vue": {
+                    "vue2": "y",
+                    "vue3": "y"
+                }
+            }
+        }
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
uni_modules/mp-html/static/app-plus/mp-html/js/handler.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
uni_modules/mp-html/static/app-plus/mp-html/js/uni.webview.min.js


+ 1 - 0
uni_modules/mp-html/static/app-plus/mp-html/local.html

@@ -0,0 +1 @@
+<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><style>body,html{width:100%;height:100%;overflow-x:scroll;overflow-y:hidden}body{margin:0}video{width:300px;height:225px}img{max-width:100%;-webkit-touch-callout:none}</style></head><body><div id="content" style="overflow:hidden"></div><script type="text/javascript" src="./js/uni.webview.min.js"></script><script type="text/javascript" src="./js/handler.js"></script></body>

+ 0 - 13
uni_modules/uv-parse/changelog.md

@@ -1,13 +0,0 @@
-## 1.0.4(2023-07-17)
-1. 优化文档
-2. 优化其他
-## 1.0.3(2023-06-19)
-1. 修复nvue模式下不显示的BUG
-## 1.0.2(2023-06-02)
-1. 修复可能存在的BUG
-2. 优化
-## 1.0.1(2023-05-16)
-1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
-2. 优化部分功能
-## 1.0.0(2023-05-10)
-uv-parse 富文本解析器

+ 0 - 87
uni_modules/uv-parse/package.json

@@ -1,87 +0,0 @@
-{
-  "id": "uv-parse",
-  "displayName": "uv-parse 富文本解析器 全面兼容vue3+2、app、h5、小程序等多端",
-  "version": "1.0.4",
-  "description": "uv-parse 该组件一般用于富文本解析场景,比如解析文章内容,商品详情,带原生HTML标签的各类字符串等,此组件和uni-app官方的rich-text组件功能有重合之处,但是也有不同的地方。",
-  "keywords": [
-    "uv-parse",
-    "uvui",
-    "uv-ui",
-    "parse",
-    "富文本"
-],
-  "repository": "",
-  "engines": {
-    "HBuilderX": "^3.1.0"
-  },
-  "dcloudext": {
-    "type": "component-vue",
-    "sale": {
-      "regular": {
-        "price": "0.00"
-      },
-      "sourcecode": {
-        "price": "0.00"
-      }
-    },
-    "contact": {
-      "qq": ""
-    },
-    "declaration": {
-    	"ads": "无",
-    	"data": "插件不采集任何数据",
-    	"permissions": "无"
-    },
-    "npmurl": ""
-  },
-  "uni_modules": {
-    "dependencies": [
-			"uv-ui-tools"
-		],
-    "encrypt": [],
-    "platforms": {
-			"cloud": {
-				"tcb": "y",
-				"aliyun": "y"
-			},
-			"client": {
-				"Vue": {
-					"vue2": "y",
-					"vue3": "y"
-				},
-				"App": {
-					"app-vue": "y",
-					"app-nvue": "y"
-				},
-				"H5-mobile": {
-					"Safari": "y",
-					"Android Browser": "y",
-					"微信浏览器(Android)": "y",
-					"QQ浏览器(Android)": "y"
-				},
-				"H5-pc": {
-					"Chrome": "y",
-					"IE": "y",
-					"Edge": "y",
-					"Firefox": "y",
-					"Safari": "y"
-				},
-				"小程序": {
-					"微信": "y",
-					"阿里": "y",
-					"百度": "y",
-					"字节跳动": "y",
-					"QQ": "y",
-					"钉钉": "u",
-					"快手": "u",
-					"飞书": "u",
-					"京东": "u"
-				},
-				"快应用": {
-					"华为": "u",
-					"联盟": "u"
-				}
-			}
-		}
-  }
-}

+ 0 - 21
uni_modules/uv-parse/readme.md

@@ -1,21 +0,0 @@
-## Parse 富文本解析器
-
-> **组件名:uv-parse**
-
-该组件一般用于富文本解析场景,比如解析文章内容,商品详情,带原生`HTML`标签的各类字符串等,此组件和`uni-app`官方的`rich-text`组件功能有重合之处,但是也有不同的地方。
-
-该插件只提供富文本的解析,该功能已经足够丰富。如果需要富文本的编辑,可使用`uniapp`官方提供的组件。
-
-# <a href="https://www.uvui.cn/components/parse.html" target="_blank">查看文档</a>
-
-## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui)
-
-### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui)
-
-<a href="https://ext.dcloud.net.cn/plugin?name=uv-ui" target="_blank">
-
-![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png)
-
-</a>
-
-#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>

+ 0 - 224
uni_modules/uv-parse/static/app-plus/uv-parse/js/handler.js

@@ -1,224 +0,0 @@
-'use strict'
-
-// 等待初始化完毕
-document.addEventListener('UniAppJSBridgeReady', () => {
-    document.body.onclick = function () {
-        return uni.postMessage({
-            data: {
-                action: 'onClick'
-            }
-        })
-    }
-
-    uni.postMessage({
-        data: {
-            action: 'onJSBridgeReady'
-        }
-    })
-})
-let options
-let medias = []
-/**
- * @description 获取标签的所有属性
- * @param {Element} ele
- */
-
-function getAttrs(ele) {
-    const attrs = Object.create(null)
-
-    for (let i = ele.attributes.length; i--;) {
-        attrs[ele.attributes[i].name] = ele.attributes[i].value
-    }
-
-    return attrs
-}
-/**
- * @description 图片加载出错
- */
-
-function onImgError() {
-    if (options[1]) {
-        this.src = options[1]
-        this.onerror = null
-    } // 取消监听点击
-
-    this.onclick = null
-    this.ontouchstart = null
-    uni.postMessage({
-        data: {
-            action: 'onError',
-            source: 'img',
-            attrs: getAttrs(this)
-        }
-    })
-}
-/**
- * @description 创建 dom 结构
- * @param {object[]} nodes 节点数组
- * @param {Element} parent 父节点
- * @param {string} namespace 命名空间
- */
-
-function createDom(nodes, parent, namespace) {
-    const _loop = function _loop(i) {
-        const node = nodes[i]
-        let ele = void 0
-
-        if (!node.type || node.type == 'node') {
-            let { name } = node // svg 需要设置 namespace
-
-            if (name == 'svg') namespace = 'http://www.w3.org/2000/svg'
-            if (name == 'html' || name == 'body') name = 'div' // 创建标签
-
-            if (!namespace) ele = document.createElement(name); else ele = document.createElementNS(namespace, name) // 设置属性
-
-            for (const item in node.attrs) {
-                ele.setAttribute(item, node.attrs[item])
-            } // 递归创建子节点
-
-            if (node.children) createDom(node.children, ele, namespace) // 处理图片
-
-            if (name == 'img') {
-                if (!ele.src && ele.getAttribute('data-src')) ele.src = ele.getAttribute('data-src')
-
-                if (!node.attrs.ignore) {
-                    // 监听图片点击事件
-                    ele.onclick = function (e) {
-                        e.stopPropagation()
-                        uni.postMessage({
-                            data: {
-                                action: 'onImgTap',
-                                attrs: getAttrs(this)
-                            }
-                        })
-                    }
-                }
-
-                if (options[2]) {
-                    image = new Image()
-                    image.src = ele.src
-                    ele.src = options[2]
-
-                    image.onload = function () {
-                        ele.src = this.src
-                    }
-
-                    image.onerror = function () {
-                        ele.onerror()
-                    }
-                }
-
-                ele.onerror = onImgError
-            } // 处理链接
-            else if (name == 'a') {
-                ele.addEventListener('click', function (e) {
-                    e.stopPropagation()
-                    e.preventDefault() // 阻止默认跳转
-
-                    const href = this.getAttribute('href')
-                    let offset
-                    if (href && href[0] == '#') offset = (document.getElementById(href.substr(1)) || {}).offsetTop
-                    uni.postMessage({
-                        data: {
-                            action: 'onLinkTap',
-                            attrs: getAttrs(this),
-                            offset
-                        }
-                    })
-                }, true)
-            } // 处理音视频
-            else if (name == 'video' || name == 'audio') {
-                medias.push(ele)
-
-                if (!node.attrs.autoplay) {
-                    if (!node.attrs.controls) ele.setAttribute('controls', 'true') // 空白图占位
-
-                    if (!node.attrs.poster) ele.setAttribute('poster', "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'/>")
-                }
-
-                if (options[3]) {
-                    ele.onplay = function () {
-                        for (let _i = 0; _i < medias.length; _i++) {
-                            if (medias[_i] != this) medias[_i].pause()
-                        }
-                    }
-                }
-
-                ele.onerror = function () {
-                    uni.postMessage({
-                        data: {
-                            action: 'onError',
-                            source: name,
-                            attrs: getAttrs(this)
-                        }
-                    })
-                }
-            } // 处理表格
-            else if (name == 'table' && options[4] && !ele.style.cssText.includes('inline')) {
-                const div = document.createElement('div')
-                div.style.overflow = 'auto'
-                div.appendChild(ele)
-                ele = div
-            } else if (name == 'svg') namespace = void 0
-        } else ele = document.createTextNode(node.text.replace(/&amp;/g, '&'))
-
-        parent.appendChild(ele)
-    }
-
-    for (let i = 0; i < nodes.length; i++) {
-        var image
-
-        _loop(i)
-    }
-} // 设置 html 内容
-
-window.setContent = function (nodes, opts, append) {
-    const ele = document.getElementById('content') // 背景颜色
-
-    if (opts[0]) document.body.bgColor = opts[0] // 长按复制
-
-    if (!opts[5]) ele.style.userSelect = 'none'
-
-    if (!append) {
-        ele.innerHTML = '' // 不追加则先清空
-
-        medias = []
-    }
-
-    options = opts
-    const fragment = document.createDocumentFragment()
-    createDom(nodes, fragment)
-    ele.appendChild(fragment) // 触发事件
-
-    let height = ele.scrollHeight
-    uni.postMessage({
-        data: {
-            action: 'onLoad',
-            height
-        }
-    })
-    clearInterval(window.timer)
-    let ready = false
-    window.timer = setInterval(() => {
-        if (ele.scrollHeight != height) {
-            height = ele.scrollHeight
-            uni.postMessage({
-                data: {
-                    action: 'onHeightChange',
-                    height
-                }
-            })
-        } else if (!ready) {
-            ready = true
-            uni.postMessage({
-                data: {
-                    action: 'onReady'
-                }
-            })
-        }
-    }, 350)
-} // 回收计时器
-
-window.onunload = function () {
-    clearInterval(window.timer)
-}

+ 0 - 19
uni_modules/uv-parse/static/app-plus/uv-parse/js/uni.webview.min.js

@@ -1,19 +0,0 @@
-!(function (e, n) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = n() : typeof define === 'function' && define.amd ? define(n) : (e = e || self).uni = n() }(this, (() => {
-    'use strict'
-
-    try { const e = {}; Object.defineProperty(e, 'passive', { get() { !0 } }), window.addEventListener('test-passive', null, e) } catch (e) {} const n = Object.prototype.hasOwnProperty; function t(e, t) { return n.call(e, t) } const i = []; const a = function (e, n) { const t = { options: { timestamp: +new Date() }, name: e, arg: n }; if (window.__dcloud_weex_postMessage || window.__dcloud_weex_) { if (e === 'postMessage') { const a = { data: [n] }; return window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessage(a) : window.__dcloud_weex_.postMessage(JSON.stringify(a)) } const o = { type: 'WEB_INVOKE_APPSERVICE', args: { data: t, webviewIds: i } }; window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessageToService(o) : window.__dcloud_weex_.postMessageToService(JSON.stringify(o)) } if (!window.plus) return window.parent.postMessage({ type: 'WEB_INVOKE_APPSERVICE', data: t, pageId: '' }, '*'); if (i.length === 0) { const r = plus.webview.currentWebview(); if (!r) throw new Error('plus.webview.currentWebview() is undefined'); const d = r.parent(); let s = ''; s = d ? d.id : r.id, i.push(s) } if (plus.webview.getWebviewById('__uniapp__service'))plus.webview.postMessageToUniNView({ type: 'WEB_INVOKE_APPSERVICE', args: { data: t, webviewIds: i } }, '__uniapp__service'); else { const w = JSON.stringify(t); plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat('WEB_INVOKE_APPSERVICE', '",').concat(w, ',').concat(JSON.stringify(i), ');')) } }; const o = {
-        navigateTo() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const n = e.url; a('navigateTo', { url: encodeURI(n) }) }, navigateBack() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const n = e.delta; a('navigateBack', { delta: parseInt(n) || 1 }) }, switchTab() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const n = e.url; a('switchTab', { url: encodeURI(n) }) }, reLaunch() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const n = e.url; a('reLaunch', { url: encodeURI(n) }) }, redirectTo() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const n = e.url; a('redirectTo', { url: encodeURI(n) }) }, getEnv(e) { window.plus ? e({ plus: !0 }) : e({ h5: !0 }) }, postMessage() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; a('postMessage', e.data || {}) }
-    }; const r = /uni-app/i.test(navigator.userAgent); const d = /Html5Plus/i.test(navigator.userAgent); const s = /complete|loaded|interactive/; const w = window.my && navigator.userAgent.indexOf('AlipayClient') > -1; const u = window.swan && window.swan.webView && /swan/i.test(navigator.userAgent); const c = window.qq && window.qq.miniProgram && /QQ/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent); const g = window.tt && window.tt.miniProgram && /toutiaomicroapp/i.test(navigator.userAgent); const v = window.wx && window.wx.miniProgram && /micromessenger/i.test(navigator.userAgent) && /miniProgram/i.test(navigator.userAgent); const p = window.qa && /quickapp/i.test(navigator.userAgent); for (var l, _ = function () { window.UniAppJSBridge = !0, document.dispatchEvent(new CustomEvent('UniAppJSBridgeReady', { bubbles: !0, cancelable: !0 })) }, f = [function (e) { if (r || d) return window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? document.addEventListener('DOMContentLoaded', e) : window.plus && s.test(document.readyState) ? setTimeout(e, 0) : document.addEventListener('plusready', e), o }, function (e) { if (v) return window.WeixinJSBridge && window.WeixinJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener('WeixinJSBridgeReady', e), window.wx.miniProgram }, function (e) { if (c) return window.QQJSBridge && window.QQJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener('QQJSBridgeReady', e), window.qq.miniProgram }, function (e) {
-            if (w) {
-                document.addEventListener('DOMContentLoaded', e); const n = window.my; return {
-                    navigateTo: n.navigateTo, navigateBack: n.navigateBack, switchTab: n.switchTab, reLaunch: n.reLaunch, redirectTo: n.redirectTo, postMessage: n.postMessage, getEnv: n.getEnv
-                }
-            }
-        }, function (e) { if (u) return document.addEventListener('DOMContentLoaded', e), window.swan.webView }, function (e) { if (g) return document.addEventListener('DOMContentLoaded', e), window.tt.miniProgram }, function (e) {
-            if (p) {
-                window.QaJSBridge && window.QaJSBridge.invoke ? setTimeout(e, 0) : document.addEventListener('QaJSBridgeReady', e); const n = window.qa; return {
-                    navigateTo: n.navigateTo, navigateBack: n.navigateBack, switchTab: n.switchTab, reLaunch: n.reLaunch, redirectTo: n.redirectTo, postMessage: n.postMessage, getEnv: n.getEnv
-                }
-            }
-        }, function (e) { return document.addEventListener('DOMContentLoaded', e), o }], m = 0; m < f.length && !(l = f[m](_)); m++);l || (l = {}); const E = typeof uni !== 'undefined' ? uni : {}; if (!E.navigateTo) for (const b in l)t(l, b) && (E[b] = l[b]); return E.webView = l, E
-})))

+ 0 - 1
uni_modules/uv-parse/static/app-plus/uv-parse/local.html

@@ -1 +0,0 @@
-<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"><style>body,html{width:100%;height:100%;overflow:hidden}body{margin:0}video{width:300px;height:225px}img{max-width:100%;-webkit-touch-callout:none}@keyframes show{0%{opacity:0}100%{opacity:1}}</style></head><body><div id="content"></div><script type="text/javascript" src="./js/uni.webview.min.js"></script><script type="text/javascript" src="./js/handler.js"></script></body>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä