Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tutorial/guide/Files and projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Everything you read lives in **Files**, the panel on the left. A project is one
Choose **+** at the top of Files:

- **Add files…** picks one or more files from your computer.
- **Add folder…** brings in a whole folder and keeps its structure. Desktop Chrome and Edge read the folder directly; other browsers use their folder upload.
- **Add folder…** brings in a whole folder and keeps its structure. Desktop Chrome and Edge read the folder directly; other browsers use their folder upload. iPhone and iPad cannot choose a folder, so there the entry is missing; add the files instead.
- **Add from URL…** downloads a file or folder from an address and opens it.

You can also drop files or folders onto Files.
On a computer, you can also drop files or folders onto Files.

**Add from URL…** understands a few kinds of address:

Expand Down
9 changes: 8 additions & 1 deletion ui-packages/web/src/formats/docx-unconverted.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const namespaces = [
'xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"',
'xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"',
'xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram"',
'xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"',
'xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"',
'xmlns:v="urn:schemas-microsoft-com:vml"',
].join(' ')
Expand Down Expand Up @@ -55,6 +56,10 @@ const diagram = drawing(
'http://schemas.openxmlformats.org/drawingml/2006/diagram',
'<dgm:relIds r:dm="rIdX" r:lo="rIdX" r:qs="rIdX" r:cs="rIdX"/>',
)
const textBox = drawing(
'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
'<wps:wsp><wps:txbx><w:txbxContent><w:p><w:r><w:t>Amount due</w:t></w:r></w:p></w:txbxContent></wps:txbx></wps:wsp>',
)

describe('unconverted Word content', () => {
it('leaves a document whose content all converts exactly as it was', async () => {
Expand All @@ -66,7 +71,7 @@ describe('unconverted Word content', () => {
expect(markdown).toBe('**Styled body**')
})

it('marks equations, charts and diagrams where they stood', async () => {
it('marks equations, charts, diagrams and text boxes where they stood', async () => {
const { markdown } = await convertDocxToMarkdown(
await docx(
[
Expand All @@ -75,6 +80,7 @@ describe('unconverted Word content', () => {
'<w:p><w:r><w:t xml:space="preserve">Inline </w:t></w:r><m:oMath><m:r><m:t>x</m:t></m:r></m:oMath></w:p>',
`<w:p><w:r>${chart}</w:r></w:p>`,
`<w:p><w:r>${diagram}</w:r></w:p>`,
`<w:p><w:r>${textBox}</w:r></w:p>`,
paragraph('After'),
].join(''),
),
Expand All @@ -85,6 +91,7 @@ describe('unconverted Word content', () => {
'Inline *(Equation not converted)*',
'*(Chart not converted)*',
'*(Diagram not converted)*',
'*(Text box not converted)*',
'After',
])
})
Expand Down
4 changes: 4 additions & 0 deletions ui-packages/web/src/formats/docx-unconverted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const namespaces = {
m: 'http://schemas.openxmlformats.org/officeDocument/2006/math',
c: 'http://schemas.openxmlformats.org/drawingml/2006/chart',
dgm: 'http://schemas.openxmlformats.org/drawingml/2006/diagram',
wps: 'http://schemas.microsoft.com/office/word/2010/wordprocessingShape',
mc: 'http://schemas.openxmlformats.org/markup-compatibility/2006',
v: 'urn:schemas-microsoft-com:vml',
}
Expand Down Expand Up @@ -59,6 +60,9 @@ const markEquations = (document: Document) => {
const drawingLabel = (drawing: Element) => {
if (contains(drawing, namespaces.c, 'chart')) return 'Chart'
if (contains(drawing, namespaces.dgm, 'relIds')) return 'Diagram'
// Word writes its text boxes twice and Mammoth reads the VML copy; a box written only this way,
// as Google Docs and generated reports do, would lose its text.
if (contains(drawing, namespaces.wps, 'txbx')) return 'Text box'
return null
}

Expand Down