# Feature OP-18098 - Support non-nested long text fields macro in PDF Export

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18098

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.0.0 |
| Sprint | 17.0.0 |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Modules and project features / Export / PDF Export |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan | Community (COM) |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Andrej Sandorf |
| Product manager |  |
| Feature Lead |  |
| Developers | Andrej Sandorf |
| Designer |  |
| Ordered by | Niels Lindenthal |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** a user  
**I want to** include long text custom fields in my work package description  
**so that** can export the information

Examples for long text field/Description macros:

``` text
workPackageValue:description
projectValue:description
projectValue:"Name of long text custom attribute"
workPackageValue:"Name of long text custom field"
```

Current behaviour:

<figure class="table op-uc-figure_align-center op-uc-figure"><table class="op-uc-table"><tbody><tr class="op-uc-table--row"><td class="op-uc-table--cell"><figure class="image image_resized op-uc-figure" style="width:368px;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/798612/content"></div><figcaption class="op-uc-figure--description">Input</figcaption></figure><p class="op-uc-p">Where "RichText" is the name of a long text custom field/long text project attribute</p></td></tr><tr class="op-uc-table--row"><td class="op-uc-table--cell"><figure class="image image_resized op-uc-figure" style="width:586px;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/798613/content"></div><figcaption class="op-uc-figure--description">PDF</figcaption></figure></td></tr></tbody></table></figure>

**Acceptance criteria**

  - Custom long text fields and descriptions referenced by a value macro are included in the exports (Meetings, Single Work package exports/Work package list "report", Project list)
    
      - A fully supported position is: start of a line (see screenshot above)
    
      - If the macro is inserted in the middle of a line and the replacement contains Markdown structures like e.g. lists, in the PDF the replacement is on their own line  
        e.g. `This is a macro:projectValue:RichtText`  
        in PDF:   
        `This is a macro:`  
        `* List item`  
        `* List item`
    
      - In nested positions, e.g. **table cells**, macros are only supported if the long text only includes basic text formatting (NOT images, tables, lists, etc.), otherwise a message "Nested rich text embedding currently not supported in export" is inserted instead

**Technical notes**

  - "Non-nested" refers to macros like `workPackageValue:richtextfield` or `projectValue:richtextfield` are not inserted into another formatting, like tables, quotes, lists, etc. As *long text fields* can contain all of those formatting structures themselves and even contain other rich text macros, which are not fully supported by the PDF ruby gem.

**Permissions and visibility considerations**

  - *No changes required for permissions, handled as with other custom fields*

**Out of scope**

  - Nested long text field macros with tables, images, etc.

**Note to the docs team**

[Documentation is updated](https://community.openproject.org/projects/openproject/work_packages/68540/activity#comment-1478928)
