(this page is translated by Google; We're working hard on a human translation)
Anticipative behavior
Under this term he can hardly imagine its true meaning. Therefore, it is in the following paragraphs I will try best to explain. And as this is a key feature Texy, an explanation will be rather are full. We will begin with a somewhat general:
Formatter, normally operate on the principle that through a series of sophisticated regular expression scanning the input text and formatting commands found confusing for HTML tags. It's quite fast and simple way. Thus the first version worked Texy.
Let's try to demonstrate in practice how it works. Consider a very simple syntax:
- Bold text: write the
*text*and it would confuse the system<strong>text</strong> - Image: entered as
[* url *], and regular expression it turns<img src="url">
Create a system in accordance with those rules, formats text. First of all searches throughout the text symbols signifying the bold and replace them with the appropriate HTML tags. In the second step searches for strings representing the file and it confuses the HTML element.
Very quickly but we find that the system is not working as it should. Let him enter this format:
This is a picture of [* images / * benny.jpg] my * dog *.
We expect this result:
This is a picture <img src="images/benny.jpg"> <strong> my dog </ strong>.
However, the system returns:
This is a picture of [<strong> images / benny.jpg </ strong>] <strong> my dog </ strong>.
Where is the problem? By replacing the first stars in the brand <strong> , damaging the string representing the image and the second step will not be found. Out of it?
Perhaps you can think of two ways:
- switch the order in which the substitution is realized
- or modify the regular expression looking for stars, so that it is ignored if the left and the right star lies square bracket.
Unfortunately, neither solution is perfect. Invert expressions are just breaking the wedge wedge. The system collapses to the input text:
This is a picture of the unusual URL: [* Images / * my * / * foto.jpg]
In the first step, adjusting it to the form:
This is a picture of the unusual URL: [* / Images / <strong> my </ strong> / foto.jpg *]
And in the second step:
This is a picture of the unusual URL: <Img src = "/ images / <strong> my </ strong> / foto.jpg">
But the user did not intend this result. The visit did not have the brand image <strong> but ordinary stars. You can argue that the stars are unusual in the address. Granted, but there may appear. Therefore, the solution is not one hundred percent.
And what kind of solution? Not much better. Programmer requires superhuman effort: to uncover all the possible interference of the regular expressions. Regular expressions become more complicated. Moreover, the universality of the system disappears, any change in the syntax will require complex treatment of all terms. Such an approach is only spawns for severe odhalitelných errors. Again, the solution is not one hundred percent.
How does it Texy
And now, when both current format means had failed, appeared on the scene Texy. A save situation :-)
But leaves advertising jargon. She actually reality is that well-known and popular formatter (Textile, Markdown, ...) for similar structures reliably collapsed. Therefore other Texy arose from the requirement for proper formatter with očekávatelným behavior.
Texy advantage is the use of a wholly techniques. The priority is speed, but the perfection and perfection of the transfer. This differs from the competition.
Still believe?
Consider the popular converter Textile . Its syntax says that the text enclosed between the star symbol will be highlighted <strong> , the text underscores the brand <em> . Moreover, it is possible immediately after the first underscore to use a modifier, such as _ (class) text_. However, if we use the modifier Stars, Textile and confuse the undue return the result. Try to get your word format:
_ (So * this * Textile) nezvládne_
But do not want to Textile crashing - on the contrary, it is a great tool!





