From 13d24316a513cc49698ae7db27c60b54901ebc34 Mon Sep 17 00:00:00 2001 From: Rex YE Date: Thu, 24 Nov 2016 14:54:49 +0000 Subject: [PATCH] li issues --- public/translate/cn/translate.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/public/translate/cn/translate.js b/public/translate/cn/translate.js index 891ef1d722..50b0e28f32 100644 --- a/public/translate/cn/translate.js +++ b/public/translate/cn/translate.js @@ -40,11 +40,17 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true'; case 'H5': case 'H6': case 'HEADER': - case 'LI': if (processBlock(node)) { i++; } break; + case 'LI': + if($(node).find('p').length <= 1){ + if (processBlock(node)) { + i++; + } + } + break; case 'TD': case 'TH': processContainer(node); @@ -54,11 +60,11 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true'; if (node.children.length > 0) { processContainer(node); // For
  • ...

  • , processes it as block. - if (node.children.length === 1) { - if (processBlock(node)) { - i++; - } - } + // if (node.children.length === 1) { + // if (processBlock(node)) { + // i++; + // } + // } } break; } @@ -107,7 +113,7 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true'; function attributesToString(node) { return _.chain(node.attributes) .map(function (value) { - if (value.name === 'id' || value.name === 'class') { + if (value.name === 'id') { return ''; } else { return value.name + '=' + value.value;