mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Property show images in Language Specification markdown
This commit is contained in:
@@ -47,6 +47,7 @@ function convertDocumentToMarkdown(doc) {
|
||||
var tableColumnCount;
|
||||
var tableCellIndex;
|
||||
var columnAlignment = [];
|
||||
var imageCount = 0;
|
||||
function setProperties(target, properties) {
|
||||
for (var name in properties) {
|
||||
if (properties.hasOwnProperty(name)) {
|
||||
@@ -120,12 +121,18 @@ function convertDocumentToMarkdown(doc) {
|
||||
var text = p.range.text;
|
||||
var style = p.style.nameLocal;
|
||||
var inTable = p.range.tables.count > 0;
|
||||
var containsImage = p.range.inlineShapes.count > 0;
|
||||
var level = 1;
|
||||
var sectionBreak = text.indexOf("\x0C") >= 0;
|
||||
text = trimEndFormattingMarks(text);
|
||||
if (inTable) {
|
||||
style = "Table";
|
||||
}
|
||||
else if (containsImage) {
|
||||
imageCount++;
|
||||
write("\n\n");
|
||||
text = "";
|
||||
}
|
||||
else if (style.match(/\s\d$/)) {
|
||||
level = +style.substr(style.length - 1);
|
||||
style = style.substr(0, style.length - 2);
|
||||
|
||||
@@ -67,10 +67,17 @@ module Word {
|
||||
export interface Tables extends Collection<Table> {
|
||||
}
|
||||
|
||||
export interface InlineShape {
|
||||
}
|
||||
|
||||
export interface InlineShapes extends Collection<InlineShape> {
|
||||
}
|
||||
|
||||
export interface Range {
|
||||
find: Find;
|
||||
listFormat: ListFormat;
|
||||
tables: Tables;
|
||||
inlineShapes: InlineShapes;
|
||||
text: string;
|
||||
words: Ranges;
|
||||
}
|
||||
@@ -180,6 +187,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string {
|
||||
var tableColumnCount: number;
|
||||
var tableCellIndex: number;
|
||||
var columnAlignment: number[] = [];
|
||||
var imageCount: number = 0;
|
||||
|
||||
function setProperties(target: any, properties: any) {
|
||||
for (var name in properties) {
|
||||
@@ -261,6 +269,7 @@ function convertDocumentToMarkdown(doc: Word.Document): string {
|
||||
var text = p.range.text;
|
||||
var style = p.style.nameLocal;
|
||||
var inTable = p.range.tables.count > 0;
|
||||
var containsImage = p.range.inlineShapes.count > 0;
|
||||
var level = 1;
|
||||
var sectionBreak = text.indexOf("\x0C") >= 0;
|
||||
|
||||
@@ -268,6 +277,11 @@ function convertDocumentToMarkdown(doc: Word.Document): string {
|
||||
if (inTable) {
|
||||
style = "Table";
|
||||
}
|
||||
else if (containsImage) {
|
||||
imageCount++;
|
||||
write("\n\n");
|
||||
text = "";
|
||||
}
|
||||
else if (style.match(/\s\d$/)) {
|
||||
level = +style.substr(style.length - 1);
|
||||
style = style.substr(0, style.length - 2);
|
||||
|
||||
Reference in New Issue
Block a user