[okapi] push by jhargrav...@gmail.com - update html filter to handle INLINE_EXCLUDED_ELEMENT rules. '.*' rule... on 2012-03-03 22:21 GMT

0 views
Skip to first unread message

ok...@googlecode.com

unread,
Mar 3, 2012, 5:22:53 PM3/3/12
to okapi-...@googlegroups.com
Revision: 02f80a040495
Author: Jim Hargrave <jhargr...@gmail.com>
Date: Sat Mar 3 14:21:13 2012
Log: update html filter to handle INLINE_EXCLUDED_ELEMENT rules. '.*'
rule
added tp config to support html5.
http://code.google.com/p/okapi/source/detail?r=02f80a040495

Modified:
/okapi/filters/html/src/main/java/net/sf/okapi/filters/html/HtmlFilter.java

/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/nonwellformedConfiguration.yml

/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/wellformedConfiguration.yml

=======================================
---
/okapi/filters/html/src/main/java/net/sf/okapi/filters/html/HtmlFilter.java
Tue Jan 10 09:47:11 2012
+++
/okapi/filters/html/src/main/java/net/sf/okapi/filters/html/HtmlFilter.java
Sat Mar 3 14:21:13 2012
@@ -142,6 +142,7 @@
final Tag tag = (Tag) segment;
boolean inlineTag = false;
if (getConfig().getElementRuleType(tag.getName()) ==
RULE_TYPE.INLINE_ELEMENT
+ || getConfig().getElementRuleType(tag.getName()) ==
RULE_TYPE.INLINE_ELEMENT
|| (getEventBuilder().isInsideTextRun() && (tag
.getTagType() == StartTagType.COMMENT || tag
.getTagType() == StartTagType.XML_PROCESSING_INSTRUCTION)))
@@ -163,6 +164,7 @@
RuleType currentState = null;

switch (ruleType) {
+ case INLINE_EXCLUDED_ELEMENT:
case INLINE_ELEMENT:
try {
currentState = getRuleState().popInlineRule();
=======================================
---
/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/nonwellformedConfiguration.yml
Tue Jan 10 09:47:11 2012
+++
/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/nonwellformedConfiguration.yml
Sat Mar 3 14:21:13 2012
@@ -351,6 +351,10 @@
ruleTypes: [INLINE]

# Excluded elements
+ '.*':
+ ruleTypes: [EXCLUDE, INLINE]
+ conditions: [translate, EQUALS, 'no']
+
style:
ruleTypes: [EXCLUDE]

=======================================
---
/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/wellformedConfiguration.yml
Tue Jan 10 09:47:11 2012
+++
/okapi/filters/html/src/main/resources/net/sf/okapi/filters/html/wellformedConfiguration.yml
Sat Mar 3 14:21:13 2012
@@ -375,6 +375,10 @@
ruleTypes: [INLINE]

# Excluded elements
+ '.*':
+ ruleTypes: [EXCLUDE, INLINE]
+ conditions: [translate, EQUALS, 'no']
+
style:
ruleTypes: [EXCLUDE]

Reply all
Reply to author
Forward
0 new messages