blob: 0e3c97d1eaafaa84bcec60f62e425f0f4e01befc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
exports.HeuristicsProcessor = HeuristicsProcessor;
function HeuristicsProcessor() {
function processHeuristics(document) {
for (var i = 0; i < document.value.children.length; i++) {
var element = document.value.children[i];
switch (element.type) {
case 'paragraph':
document.value.children[i] = processParagraph(document.value.children[i]);
break;
}
}
return document;
}
function processParagraph(element) {
if (element.alignment == 'center' && !element.styleName) {
element.styleName = "CenteredHeading";
}
return element;
}
return {
processHeuristics: processHeuristics
}
}
|