Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

use a regular expression to extract the numeric id

as-op61944a5409b5
diff --git a/app/models/work_package/pdf_export/export/markdown.rb b/app/models/work_package/pdf_export/export/markdown.rb
index 15d5397cda5..5e27f6d95b8 100644
--- a/app/models/work_package/pdf_export/export/markdown.rb
+++ b/app/models/work_package/pdf_export/export/markdown.rb
@@ -94,7 +94,7 @@ module WorkPackage::PDFExport::Export::Markdown
# clear the text content, so it does not get rendered
next_node.string_content = ""
end
- wp_mention_macro(tag.attr("data-text") || "", id.delete("#"), opts)
+ wp_mention_macro(tag.attr("data-text") || "", id[/\d+/], opts)
end
def expand_wp_mention(work_package, content)