0

I am working on a web based application that generates documents with some data. I have a new feature in the document generator, you can paste an Atlassian Confluence (in our company we use this as wiki) link in a textbox and on save the content from this specific page will appear in the document.

1. Problem: I have no possibility to get row data from the API of Atlassian Confluence without CSS-Classes.

2. Problem: I use in the document generator Bootstrap 3 and Atlassian Confluence use some Bootstrap classes too. This means: The Atlassian Confluence stylesheet recolor and resize the element on my page and I cannot create a new stylesheet for the content from Confluence because there are some special things and I don’t have the time to do that.

Question: Is there any possibility or workaround to fix this problem with the options of ASP.NET and Razor?

Jeroen
  • 1,168
  • 1
  • 12
  • 24
Yannik
  • 887
  • 3
  • 9
  • 29
  • when you save the data pasted in (presumably this is what contains the CSS references?), then strip out anything that's a CSS reference (either ` – ADyson Nov 15 '16 at 12:51
  • @ADyson you paste a link of the website in the textbox example: `wiki.mycompany.xyz/mynewpage.html` and then I create a call to the API and get back `HTML` with the styleclasses and style-tags. I dont want create a own stylesheet or a filter for the Confluence-Stylesheet because I have no time. But when there is no choise I will do that – Yannik Nov 15 '16 at 13:05
  • ok, then you could strip the CSS references from the HTML you get back before you display it. Same process as I suggested, just different source of the HTML. Regular expressions would probably be a good tool to do this, or a HTML parser that can manipulate the DOM. You could even do it in Javascript just before you display the content. – ADyson Nov 15 '16 at 13:10
  • @ADyson that sounds nice thank you – Yannik Nov 15 '16 at 13:33

1 Answers1

0

Solution for my Case:

I created a new cshtml Page called "WikiContent". In this Page I render the Content from Attlasian Confluence with the Styling from Confluence. In my Document Page I created an <iframe> which renders the Page "WikiContent" with some Parameters.

I used the Answer from this Question to style and resize the <iframe> with JavaScript. I also added a Width of 100% to the <iframe>.

Community
  • 1
  • 1
Yannik
  • 887
  • 3
  • 9
  • 29