Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed May 05, 2010 3:03 pm   

HTML Log
 
I keep having a problems with HTML log.

1. I have the following line substituted to the screen:

Code:
%concat("<color green green>",%repeat("#",22),"</color><color gold green>EQUILIBRIUM</color><color green green>",%repeat("#",22),"</color>")


In the log it comes out like this:

Code:
<span style="color:green;background-color:green;">######################</span><span style="color:gold;">EQUILIBRIUM</span><span style="color:green;">######################</span><br/>


It can't seem to keep track of the background colors.


2. The log will not keep track of spaces so I have to put in these stupid fillers, which is seriously annoying and it breaks the output and makes it all jumbled when I print out table like structures.

What can be done about that? I noticed you can #print {&nbsp;} and it prints a space, but in log it can't seem to recognize that either and you get � . Of course I didn't really expect &nbsp; to work, but I am not sure how to keep the space.

3. I thought Cmud recognized HTML tags now? Would it be possible to create actual HTML tables? I assume you would have to put it all on one line but you could add your table colums rows and then values in the fields etc and print to screen and in log it would actually be a table too. I am not sure how it would work. Just curious.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed May 05, 2010 4:51 pm   
 
1) Confirmed and added to bug list. This won't be fixed for the public version though as it requires changes to a 3rd party html component.

2) If you put the spaces within quotes, then they should be written to the log file. You can try using the #WRITELOG command.   is not supported.

3) CMUD does *not* recognize HTML. It recognizes MXP, which is different. No, there is no way to create an HTML table, and there probably never will be, sorry. I'm not going to write an entire web browser here. And real web browsers cannot scroll raw text as fast as needed for a MUD client.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed May 05, 2010 6:17 pm   
 
Quote:
If you put the spaces within quotes, then they should be written to the log file. You can try using the #WRITELOG command. is not supported.


Well I tried that too and it didn't work. I just stick in a filler character and color it the same as the background and use Consolas font to make it come out right.

Quote:
CMUD does *not* recognize HTML. It recognizes MXP, which is different. No, there is no way to create an HTML table, and there probably never will be, sorry. I'm not going to write an entire web browser here. And real web browsers cannot scroll raw text as fast as needed for a MUD client.


Well I didn't expect you to. I just thought I saw you said somewhere it recognized HTML tags. Just disregard. Very Happy

By the way, in the MXP help files it says:

Quote:
&nbsp;
As in HTML, the &nbsp; entity can be used to indicate a non-breaking space character. Text will not be word-wrapped at this space by the client.


Shouldn't that record in an HTML log as &nbsp; so it works when you view it in browser?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed May 05, 2010 7:02 pm   
 
I tried writing spaces to a log file and it worked fine. Maybe you are viewing the log file with a web browser which removes the extra spaces. In an HTML file, all extra whitespace is ignored. That is how HTML works. So even if your log file has five spaces in the row, only a single space will be displayed in the web browser that is viewing the html file. You cannot line up columns in HTML using space characters. That's why HTML has tables. The only other way to preserve spaces is using the PRE tag in the HTML file around your text.

Regarding   and MXP, the entry in the MXP help file means that when the   is received from the MUD, then CMUD will treat it as a non-breaking space and will not word-wrap it. However, once this is converted to an actual space character on the screen, that distinction is lost when it is captured for output to the HTML log file.

It's sort of like the issues with ANSI control codes. CMUD doesn't save the "raw codes" received from the MUD. When a line is written to the log file, the colors and MXP tags are recreated based upon the text appearing on the screen and then written to the file. All of your spaces are getting written to the file, but there is no way to mark them as non-breaking spaces at this time. You'd need to apply some external conversion to convert multiple spaces into non-breaking spaces.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 07, 2010 3:12 pm   
 
Gotcha Zugg. I just use the fillers and it works fine with a font like Consolas. It keeps the spacing of characters correctly.

The only real problem is the coloring. Aside from not tracking the background colors, I had to turn off HTML logging period because it breaks the colors. Half the log was the color of one sub because it didn't catch the end color tag and turned every line that background color.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri May 07, 2010 4:34 pm   
 
Quote:
I thought Cmud recognized HTML tags now?

I was thinking about this last night and I think where you might have seen that was regarding the Window/Editor window. The Editor window has some basic HTML support in it and actually does support tables and stuff. I've been messing with the code of this 3rd party HTML editor component recently to get it working with the new HTML help files for TeSSH and have found a lot of bugs in it. It seems to have been written a long time ago for HTML 1.0 (remember when a lot of tags like P and DD and DT didn't require closing tags?).

Anyway, the Editor has more HTML support than CMUD itself (which is just MXP) so you might have seen some discussion about this in some other threads about HTML Logging because in many cases people are using the Editor window in CMUD to read the HTML log files.
Quote:
I thought Cmud recognized HTML tags now?

Yep, I'll try to get the background color issue fixed soon.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri May 07, 2010 6:26 pm   
 
Btw, the idea of using a # filler with the same foreground/background color is pretty clever. I like it.

This bug is actually a bit more serious because it also effects the #CAPTURE command. Do this:
Code:
#mxp %concat("<color green green>",%repeat("#",22),"</color><color gold green>EQUILIBRIUM</color><color green green>",%repeat("#",22),"</color>")
#capture test

(with the MXP Capture option enabled of course) and you'll see a similar problem in the "test" window with the background colors not tracking properly. Works fine when using ANSI colors, but not with MXP colors. So I've elevated the priority of this a bit.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net