liuzhe02 / bigbluebutton

Automatically exported from code.google.com/p/bigbluebutton
0 stars 0 forks source link

Unable to paste in XML into Chat #1769

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We've had users who were using BigBlueButton to teach an on-line class and 
wanted to share samples of XML and HTML, but pasting XML or HTML into the chat 
does not show correctly.

To reproduce,
1.  Start the latest build of 0.9.0-dev (or 0.81)
2.  Paste in the following XML

<!DOCTYPE html>
  <html>
    <head>
      <meta http-equiv="Refresh" content="0;url=bigbluebutton.org" />
  </head>
</html>

The chat window will only transfer

<!DOCTYPE html> 

Other users should see the full XML

Original issue reported on code.google.com by ffdixon@gmail.com on 24 Jul 2014 at 2:24

GoogleCodeExporter commented 9 years ago

Original comment by ritza...@gmail.com on 24 Jul 2014 at 7:30

GoogleCodeExporter commented 9 years ago

Original comment by ffdixon@gmail.com on 25 Jul 2014 at 10:07

GoogleCodeExporter commented 9 years ago
I have a fix that displays the example HTML text correctly but do should we 
handle a more complex text. As an example if we write
<a href="http://bigbluebutton.org/">BigBlueButton Website</a>
The ChatUtils.parseURLs method will parse this string. How does it need to be 
displayed ?

Original comment by ghazi.no...@gmail.com on 5 Aug 2014 at 8:34

GoogleCodeExporter commented 9 years ago
Hi Ghazi,

If you look at the comment you just entered in Google Code, it shows the HTML 
with the link highlighted.

That's what we want to provide in the BigBlueButton chat: show the text as 
entered and highlight the links.

Original comment by ffdixon@gmail.com on 5 Aug 2014 at 8:58

GoogleCodeExporter commented 9 years ago
Hi Fred,

Is there any restriction about using ActionScript 3 swc libraries? I need 
as3-commons-lang library http://www.as3commons.org/as3-commons-lang/index.html 
in order to access advanced String manipulation.
Can I use it?

Original comment by ghazi.no...@gmail.com on 6 Aug 2014 at 11:29

GoogleCodeExporter commented 9 years ago
Hi Ghazi, no restrictions. If it compiles and works. We probably won't need the 
lib packaged?

Original comment by ritza...@gmail.com on 6 Aug 2014 at 1:35

GoogleCodeExporter commented 9 years ago
Hi Ghazi,

I just sent a pull request with the changes for this issue, I'm not quite sure 
if this completely works fine... Basically, I change the cleanup to parse the 
text as XML... 

And I made some modifications on the URL detection (I hope that my regex rules 
are fine), I tried with some urls and it worked fine...

See: https://github.com/bigbluebutton/bigbluebutton/pull/351

Please, feel free to improve/change/discard this solution

 - Markos

Original comment by mcmarkos86 on 6 Aug 2014 at 11:53

GoogleCodeExporter commented 9 years ago
Hi Markos,

Thank you for your proposal. I have added some comments to your code to show 
what it does not fit well.

Original comment by ghazi.no...@gmail.com on 7 Aug 2014 at 2:20

GoogleCodeExporter commented 9 years ago
Hi Ghazi,

Thanks, I just replied to your comments! When I sent the pull request, I didn't 
notice that you already sent one... I'm sorry for the confusion...

Besides the code review, I strongly suggest you to give a try to this solution, 
you can do the following (just in case upstream points to the bigbluebutton 
repo):
git fetch upstream refs/pull/351/head:pull_351
git checkout pull_351

I tried the pull request that you sent, and I think that it needs to handle 
some extra cases that I think you missed... For example, if you try sending a 
text with just a URL like "http://bigbluebutton.org", it doesn't work, the text 
is never sent to the server... Another text sample is "http://www.google.com", 
in this case the text is broken in two lines... If you send a text with not 
only a URL it works fine...

By checking both solutions, I think that we had the same approach... So, I 
think that it can be merge both solutions into one like I mentioned in my 
previous comment, please feel free to improve/change/discard this solution...

Cheers, Markos

Original comment by mcmarkos86 on 7 Aug 2014 at 3:07

GoogleCodeExporter commented 9 years ago
Hi Markos,

I fixed my regex looping and now simple https links are correctly processed. I 
also did a little benchmark for both of our scripts using 
"http://bigbluebutton.org" HTML source. The script you have wrote is 3 to 4 
times slower. And sometimes we got only line displayed after processing a 
string like bbb.org HTML source.

Regards, Ghazi

Original comment by ghazi.no...@gmail.com on 8 Aug 2014 at 11:38

GoogleCodeExporter commented 9 years ago
Marking as fixed

  https://github.com/bigbluebutton/bigbluebutton/pull/349

Original comment by ffdixon@gmail.com on 8 Aug 2014 at 11:36