Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

junk output with auto_link #42

Closed
aaronpk opened this issue Oct 14, 2023 · 1 comment
Closed

junk output with auto_link #42

aaronpk opened this issue Oct 14, 2023 · 1 comment

Comments

@aaronpk
Copy link
Collaborator

aaronpk commented Oct 14, 2023

Minimal case to reproduce:

<?php
ob_start();
require('cassis.js');
ob_end_clean();

$str = 'Hello World';

$autolinked = auto_link($str);

echo $autolinked."\n";

Outputs:

$ php test.php
 <!--   ///
  var $args, $afterchar, $afterlink, $do_embed, $fe, $i, $isjs,
      $mi, $mlen, $ms, $re,
      $sp, $spe, $spliti, $t, $wmi, $yvid;
  /// --> Hello World

Note that this happens with cassis.js not cassis.php when running under PHP 8.2

@aaronpk
Copy link
Collaborator Author

aaronpk commented Oct 15, 2023

This was user error, you are supposed to wrap all calls to cassis functions in ob_start. This was made more explicit in the documentation here:

900b030#diff-f086952b7ce012843e10d2e3a14eb2b57a88f23ddeec7f8ccd31e7df05f4fc9aR6

@aaronpk aaronpk closed this as completed Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant