Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add a reporter Markdown function for styled output #691

Open
jasonwuwrf opened this issue Jan 21, 2025 · 1 comment
Open

[FR] Add a reporter Markdown function for styled output #691

jasonwuwrf opened this issue Jan 21, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@jasonwuwrf
Copy link

Is your feature request related to a problem? Please describe.
When processing a report into a Word document, processing a tag {{ case.description|markdown }} will only strip the markdown out. It does not translate the markdown into the report styling based on the original author's writing and decisions made to format their report.

Describe the solution you'd like
The Markdown function amounts to just stripping out the contents to line feeds, create a companion function to process the proper DOCX or HTML output required for the report. Create a new function to use, that would supplement the functionality in iris-web/source/app/iris_engine/reporter /reporter.py to translate it to the report formatted output called.

    @staticmethod
    def markdown_to_text(markdown_string):
        """
        Converts a markdown string to plaintext
        """
        return markdown_string.replace('\n', '</w:t></w:r><w:r/></w:p><w:p><w:r><w:t xml:space="preserve">').replace(
            '#', '')

Describe alternatives you've considered
N/A

Additional context
N/A

@jasonwuwrf jasonwuwrf added the enhancement New feature or request label Jan 21, 2025
@jasonwuwrf
Copy link
Author

This may be related to #341 bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant